Chap 3: 100YWeatherSmall.data $exists doesn't return document

I used the same filter in Atlas cluster and it returned documents, but not in shell. Any idea:
image

@Nu_81142 Make sure you’re providing the collection name, it looks like you maybe passing the db name again after switching to “data”. After you issue “use data”, then do a “show collections”. The “db” portion of the command is an implied reference to the current database.

HTH,
Mike

You should not have run use data command as it will switch the current database to data instead of 100YWeatherSmall which has collection data

 > use 100YWeatherSmall
 > db.data.find({....})

db is the current database you are working on which is 100YWeatherSmall and data is the collection name in the db.

Kanika

2 Likes