Not getting any data based on the filtering query, but data exists

I am going through the chapter 3 and learning the operators. While doing via Compass, the query is not returning the data. However, doing it via the MongoDb shell, it works fine. See the Compass screenshots.
The query filter i am using is {“mppaRating”:{$exists: true}}

image

Are you sure that it is mppaRating that your are looking for?

When the system does not respond like it should. It is often a typo problem. That’s the first thing you should check.

Yes, I did check that. and it exists with the correct case.

However, I just tried it again, the same exact query string, and it worked this time. I cannot comment why it worked this time and why it was not working earlier as I am not the expert for MongoDB.

Thanks for responding though.

You’re using the latest Compass version 1.20.4… I’ve noticed this same bug. Plus it was a local connection.

Yes, my compass version is 1.20.4

The field is mpaaRating not mppaRating. It is not version related.

1 Like

Thanks. Yes, it was my mistake when trying on Compass vs Mongo shell.

Sorry for the confusion.

Good shout @steevej-1495.

As a side note, I have experienced this problem of an “empty collection” with the most simplest of criteria (which previously produced results) and it only happened with this version of Compass. At the same time, I opened up an older version in parallel and the same criteria produced the intended results. Refreshing the connection (to localhost) eventually resolved the issue. How can it lose connection to localhost??

Besides that, this message of an “empty collection” is very misleading and overtly inaccurate. It should state something along the lines of, “the query returned 0 documents” or “No preview documents” just like it does on the Aggregations tab. It has to be a bug.


Feedback for @Shubham_Ranjan

1 Like

Its mpaa not mppa. Its not any version related issue. Its just a simple typo mistake.

@steevej-1495 and @007_jb

Great work guys :clap: .

I will surface this issue to the relevant team and we will have it fixed as soon as possible.

Thanks,
Shubham Ranjan
Curriculum Services Engineer