Use $ne
(for “not equal”)
db.collection.find({ "fieldToCheck": { $exists: true, $ne: null } })
More Related Contents:
- Does MongoDB’s $in clause guarantee order
- Authentication failure while trying to save to mongodb
- Possibility of duplicate Mongo ObjectId’s being generated in two different collections?
- How to change the type of a field?
- MongoDB logging all queries
- Mongoose — Force collection name
- Fastest way to remove duplicate documents in mongodb
- Using map/reduce for mapping the properties in a collection
- Unhandled promise rejection: Error: URL malformed, cannot be parsed
- How to query MongoDB to test if an item exists?
- Find duplicate records in MongoDB
- Working with special characters in a Mongo collection
- How to return Mongoose results from the find method?
- Mongo sort on a calculated condition
- MongoDB: output ‘id’ instead of ‘_id’
- MongoDB: Updating subdocument
- MongoDB: Calculate dwell time between every status value change
- How to export all collections in MongoDB?
- Dealing with schema changes in Mongoose
- How to ignore nulls while unmarshalling a MongoDB document?
- How to use mongoimport to import CSV files?
- Remove Duplicates from MongoDB
- Spring data MongoDb: MappingMongoConverter remove _class
- How to access overall document count during arithmetic aggregation expression
- How to find min value in mongodb
- Does MongoDB support floating point types?
- How to deal with the timezone issue when storing dates in utc using mongod?
- Fuzzy Searching with Mongodb?
- Sum in nested document MongoDB
- Clone a collection in MongoDB