Basically, the end goal is to provide a default scope to all my DB queries. This means limiting all queries to a set of object IDs. My question is, how can I query by ID and make sure that the query is limited to my list of Object IDs?
I'd like to do something like this:
db.posts.findOne({_id: ObjectId("50eb4a874947fb00e3cc0612")})
.where({_id: { $in: [ObjectId("50eb4a874947fb00e3cc0610"),ObjectId("50eb4a874947fb00e3cc0611")] }});
As You can see, the query should return no results because the queried ID is not in the $in array of object IDs.
Btw, the above query just gives me an error saying db.posts.findOne({_id: ObjectId("50eb4a874947fb00e3cc0612")}).where is not a function (shell):1