Avoid running queries on an ongoing condition writing. (match, lookup...)
when performing a match, lookup or other similar ops, Don't run the query as I write the conditions but only when I'm done. this will improve speed significantly and will prevent crashes due to lack of memory on very large sets.
when an operation that filters data occurs, you can add a small toggle btn when I'm done writing the query, and only then perform the search.
another idea is to add a boolean field named done which on init will be set to false, and when a user is done writing the query it sets it last to true.
the benefit of the field is it will be applicable also in text mode and not just stages.
attached an example.
-
AdminMassimiliano (Admin, MongoDB) commented
In the aggregation builder, it is possible to disable the stage preview (see screenshot attached) and only enable it when you want to take a look at the results. Would that be a good way to solve your use case?