Need Help Optimizing Empty Query Latency

Hey wanted to know from you all, that I have a simple get query with indexes set up, but the response time is really high, even though there are no documents in that collection to return, it returns really high response time of 300ms, how to lessen it, please give some ideas on it?

Hey @Sahil_Anower,

Welcome to the MongoDB community!

In order to better understand the issue you are encountering could you please share some more information related to it, such as:

  • What version of MongoDB are you using?
  • Can you share a sample document structure and approximately how large the collection is?
  • Please include the specific query that you are executing.
  • An explain() output of the query.
  • Are you executing this query from a driver like the MongoDB Node.js driver or from the mongosh shell?

With these specifics, we should be able to better assist you. Also, feel free to sanitize any sensitive field names or values.

Look forward to hearing from you.