How do I perform an OR operation query in nodejs / MongoDB?
2 answers
Use the $ operator or ( http://docs.mongodb.org/manual/reference/operator/query/or/):-
db.table.find({$or:[{"groupA": data},{"groupB": data}]},
function(err, records){
//code to be executed.
});
+3
source to share