mongoose find where two attributes are equal code example
Example 1: mongodb find documents where two fields are equal
db.myCollection.find( { $where: "this.a1.a != this.a2.a" } )
Example 2: mongoose find multiple conditions
User.find({$or:[{region: "NA"},{sector:"Some Sector"}]}, function(err, user)
{
if (err)
{
res.send(err);
}
console.log(user);
res.json(user);
});