0

I need to obtain all the documents in a collection that doesn't have an specific key called "_content_Type".

I was attempting to compare with null or "" but it doesn't work.

db.fs.files.find({"_contentType":""}).count()

0

1 Answers1

2

you can use $exists operator: { _contentType: { $exists: false } }

aaronlukacs
  • 389
  • 2
  • 8