Good morning kanika mam
plzz help me with this .
The most important question is, “what do you want help with”?
Kanika may know a lot, but they’re not a mind-reader
db.movieDetails.find({rated: {$nin: ["PG", "R"]}}, {title: 1, rated: 1}).pretty()
thanks for replying.
but i wanna know why my solution is incorrect. there must be some hidden concept.
If you want to multiple conditions on the same field you need to use $and (in some cases $in/$nin) operator. Otherwise you only query on last condition ($ne: “R” is your case).