Related Tags:
MongoDB MongoDB is a cross-platform document-oriented database program. Classified as a NoSQL database program, MongoDB uses JSON-like documents with optional schemas. Learn More, MongoDB Compass MongoDB Compass is the GUI for MongoDB. Compass allows you to analyze and understand the contents of your data without formal knowledge of MongoDB query syntax. Learn More,

how check for not null against a field in mongodb using mongodb compass?

Description:I have string field "UserId" for which I need to get all those records where "UserId" not equal to null, i.e "UserId" has some value for the record

Posted by: | Posted on: Jul 28, 2020

1 answers

Replies

6

You can check for not null values / get all the records where the field has some value by placing the following filter.

{ UserId : {$ne : null} }

Replied by: | Replied on: Jul 30, 2020



Reply
×

Code block Hyperlink bold Quotes block Upload Images

Preview