How we can use $count clause in MongoDB Compass

The size of the collection might be the reason then. It’s possible that the count times out. You can try expanding the query bar by clicking on Options. On the bottom right, you’ll be able to set maxTimeMS. By default, it’s set to 5000 but you can increase it.

2 Likes