I'm looking to provide a list of potential matches to a Node-based Mongo query, and can't seem to find existing examples of how it is done.
A simplified example of the way I am getting results back for single strings is as follows:
myCollection.find({"index" : index}).toArray(function (err, items) {
if (items && items.length > 0){
res.status(200).send(items);
}
else {
res.status(404).send("NOT FOUND");
}
});
How can I modify this so that I can pass in a list of indexes, instead of a single value, and have all fully matching results returned?
EDIT: I don't believe this question is a complete duplicate - the other question deals with returning a single response, whereas I need all matches in that list