Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MongoDB equivalent of WHERE IN(1,2,...)

Tags:

java

mongodb

I have a list of userIDs and I want to pull out every document (naturally ordered) from a collection that are associated with one of these user IDs. Is there a MongoDB equivalent of the SQL WHERE IN?

like image 362
christophmccann Avatar asked Dec 15 '10 16:12

christophmccann


Video Answer


1 Answers

Yes, use Mongo's $in operator.

like image 129
ceejayoz Avatar answered Oct 17 '22 13:10

ceejayoz