How can I use _id in $in.
array('name' => array(
'$in' => array('name1', 'name2')
))
This is how $in is used in mongodb. But I don’t know how to use $in with _id.
I used
array('_id' => array(
'$in' => new MongoId(array(My Ids))
))
But it didn’t work.
You have to provide an array of MongoId‘s and not an MongoId of array (which is not possible).
So you have to preprocess you array before query or keep these ids as MongoId