Is it possible to do an OR in the $match?
I mean something like this:
db.articles.aggregate(
{ $or: [ $match : { author : "dave" }, $match : { author : "john" }] }
);
aggregation-frameworkmongodb
Is it possible to do an OR in the $match?
I mean something like this:
db.articles.aggregate(
{ $or: [ $match : { author : "dave" }, $match : { author : "john" }] }
);
Best Answer
Like so, since the
$match
operator just takes what you would normally put into thefind()
function