Thursday, 5 November 2015

MongoDB find, fields not null


There is no such function for not null in mongodb.

you should do like this:


db.student.find({"studentid":{$exists:"true"}})

https://docs.mongodb.org/manual/reference/operator/query/exists/

No comments:

Post a comment