Returning large amount of locations


I have millions of documents in the database and each document represents a property.
Users need to be able to apply filters to get specific properties and these properties are later displayed on a map.
The filters are dynamic, so users sometimes add let’s say year built and just look for properties that have been sold. With that said an aggregate operation might return +100k if not millions of records and with indexes in place, mongodb is still slow processing such amount of data.

Any suggestions?
Thank you

Hi @Idriss_57202,

Welcome to the MongoDB Community forums :sparkles:

To understand your use case better, could you please provide further details, such as:

  • The sample document from your MongoDB dataset.
  • The MongoDB Version you are using.
  • The expected result documents.
  • Any queries that you have tried to achieve the required results?

Could you please quantify the amount of data – or

  • share the output of db.<coll_name>.stats(),
  • the number of documents in your collection,
  • details of the indexes you have created, and
  • also the explain output of the aggregation operation you have performed?

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

Look forward to hearing from you.