Today, a find command can be executed against a view which contains blocking stages like $sort or $group that can consume a lot of memory. These stages will fail at runtime if the data size exceeds some memory threshold. If the user runs an aggregate command against the view, they can specify that disk use is allowed during execution of the query. The execution engine will relieve memory consumption by spilling to disk, allowing the query to succeed.
The same cannot currently be achieved with a find command. However, we recently added support for the allowDiskUse option in the find command: see related ticket SERVER-42077. This ticket tracks the work to make sure that the allowDiskUse option is respected when executing a find command against a view, and to add an integration test proving this works correctly.
- is related to
-
SERVER-7694 external sort for find command
- Closed
-
SERVER-42077 Add 'allowDiskUse' option to find command
- Closed