How does one implement a logical OR on the same JSON field when querying Mongo from NodeJS?
In particular, I have the following line:
collection.find({"user":req.user.email, "parent._id":0}, function(err, activities){
if (err) throw err;
res.json(activities);
});
How could I properly include entries such that "parent":{} is also allowed?
The following gives me an empty array:
collection.find({"user":req.user.email, "parent":{}, "parent._id":0}, function(err, activities){
if (err) throw err;
res.json(activities);
});