Home Azure mongodb $in query not working
Reply: 0

Azure mongodb $in query not working

user957
1#
user957 Published in April 26, 2018, 1:47 pm

I have employee collection with 140 documents

{

    "name" : "name1",

    "dept" : "tech",

    "address" : "adr3"

}

In all 140 documents dept is tech When I execute the query in azure mongodb

    MongoDatabase db = mongo.getDatabase("test")
    def query = new BasicDBObject(['dept':['$in':['tech']]])
    FindIterable documents = db.getCollection("employees").find(query)
    def outList =  documents.collect {it}

I get only 101 documents instead of 140 records

This works fine in local mongodb. Till last week this was working in azure for me. Am I doing something wrong here ? Anyone facing similar situation ?

If I change query to

def query = new BasicDBObject(['dept':'tech'])

I get all 140 documents

If I change batch size to 10, $in query returns only 10 documents.

You need to login account before you can post.

About| Privacy statement| Terms of Service| Advertising| Contact us| Help| Sitemap|
Processed in 0.505168 second(s) , Gzip On .

© 2016 Powered by mzan.com design MATCHINFO