Created
December 10, 2022 08:49
-
-
Save vanleantking/3c4e3617afeeaddefba97793bd1b4173 to your computer and use it in GitHub Desktop.
MongoDB aggregation allowUseDisk
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
MongoDB aggregation stage limits | |
Aggregation works in memory. Each stage can use up to 100 MB of RAM. You will get an error from the database if you exceed this limit. | |
If it becomes an unavoidable problem you can opt to page to disk, with the only disadvantage that you will wait a little longer because it is slower to work on the disk rather than in memory. To choose the page to disk method, you just need to set the option allowDiskUse to true like this: | |
db.collectionName.aggregate(pipeline, { allowDiskUse : true }) | |
Note that this option is not always available shared services. For example Atlas M0, M2 and M5 clusters disable this option. | |
https://studio3t.com/knowledge-base/articles/mongodb-aggregation-framework/ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment