I am trying to use the following query in MongoDB but it is not working.
db.test.aggregate(
$match: {$and: [type: {$in: [\"TOYS\"]}, type: {$nin: [\"BARBIE\"
If anybody wants to refuse my answer it's ok, this is a typical question with lack of research
db.test.find( {$and: [ {"type": {$in: ["TOYS"]}},
{"type": {$nin: ["BARBIE"]}},
{"time": {$lt:ISODate("2013-12-09T00:00:00Z")}}
]
})
AND works with FIND, receives an array of matches (but it's not a match instruction) Aggregation framework is for something completely different, it's like the word says, for aggregating (count, sum, avg, and so worth grouping or unwinding, etc)