mongodb filter multiple conditions code example
Example 1: mongodb aggregation $filter multiple conditions
cond: {
$and: [
{ $gte: ['$$item.timestamp_start', fromTimestamp] },
{ $lt: ['$$item.timestamp_start', toTimestamp] }
]
}
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);
});