2

The question is, how to find data in my db, where city != null?

       userdata.find({ /*???*/ }, function (err, results) {
         if (!err) console.log(results)
         ...
       });
Bim Bam
  • 429
  • 1
  • 6
  • 17

1 Answers1

1

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)
})