Supposed that a collection has billions of documents. Can mongodb handle queries that have hundreds of filter conditions on this collection by millions of users simultaneously? Assuming that this collection is indexed properly?
Asked
Active
Viewed 29 times
0

Bear Bile Farming is Torture
- 4,317
- 4
- 27
- 61
-
You have some hard coded limits in mongoDB: max possible document is 16MB and max nesting depth is 100 which apply also to the document you pass to the find() and aggregation() operations , but such kind of queries are very unusual maybe you can provide more details about what you intend to do , there could be other ways ... – R2D2 Oct 28 '22 at 08:16
-
1@R2D2 The document limit and max nesting dept is fine. They will not be exceeded. The reason for queries having so many conditions is because the user is free combine `or` statements with `and ` statements arbitrarily. So even if a document only contain 50 fields, the number of filter conditions can balloon easily. – Bear Bile Farming is Torture Oct 28 '22 at 13:51