How to add tags and then search for tags using Node.js client?

The docs is not available for node.js client for tags. I’m assuming we can use “_tags” attribute name while adding our objects for indexing. Am I correct?

addObject:
 {
   _tags:  ['tag1', 'tag2'], <--- is this correct?
    key1: val1,
    key2:  val2
}

Hi,

Yes, you can add tags to your object using the the special attribute “_tags”:

index.addObject({
  key1: "value1",
  key2: "value2",
  _tags: ['tag1', 'tag2']
}, function(err, content) {
  console.log(content);
});

Then you can search and filter by tags like this:

index.search('value1', {
  filters: '_tags:tag1'
}, function searchDone(err, content) {
  console.log(content);
});

Don’t hesitate to contact us again if you have any other questions.
Thanks!