The question is, how to find data in my db, where city != null
?
userdata.find({ /*???*/ }, function (err, results) {
if (!err) console.log(results)
...
});
The question is, how to find data in my db, where city != null
?
userdata.find({ /*???*/ }, function (err, results) {
if (!err) console.log(results)
...
});
you can use $exists
. The documentation is here
it should be like this
useedata.find({ city: { $exists: true } }, function(error, results) {
if (!error) console.log('results' + results)
})