Basic question on mongosh vs Mongo DB Compass

I dont understand why when I run this query in mogosh, I have the count result which is displayed and why when I run it in DB Compass nothing happen
What is wrong please?


Hello :wave: @jip31,

Could you please share the screenshot of the MongoDB compass and mongosh?

Also, share the log file snippet from the MongoDB Compass after executing this query to better understand the issue. You can find the log file from Help → Open Log File


Here is the screenshots


Hi @jip31,

Thanks for sharing the screenshot.

In MongoDB Compass, when you run a query you see the number of results without the need for a count.

For example, input the following query


and you will see the total count of documents as shown in the screenshot.

I hope it answers your question.


Thanks a lot
Sorry I work on Mongo DB since 2 days and I try to understand :wink:

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.