Say I have a Model that looks like this:
{ name: String, category: String }
And I got an Array with objects like this:
var array = [{
{ name: "a", category: "A" }
, { name: "b, category: "A" }
, { name: "b", category: "B" }
}]
Now I want to find all objects that matches the value pairs in the array. If it was an array of Strings only, the code would be something like Model.find({ name: {$in: array } }), but I need something like
Model.find({ name,category: {$in: array} })
Is this possible?