OperationFailed: Sort operation used more than the maximum XXX bytes of RAM. Add an index, or specify a smaller limit.
This can happen because of a bug like SERVER-13611 (so make sure you are on the latest version),
or because you are trying to sort on a sparse index in 2.6,
but more usually it is because you are simply attempting to sort too many records in memory without an index.
The specific limit you are hitting is intentional and is documented here – it cannot be changed,
so you need to reduce the set of results, or use an index etc. to perform the sort.
OperationFailed: Sort operation used more than the maximum XXX bytes of RAM. Add an index, or specify a smaller limit.
The upcoming 2.8 release (2.8.0-rc0 as of writing this) does now allow this setting to be tweaked, as follows:
db.adminCommand({setParameter: 1, internalQueryExecMaxBlockingSortBytes: <limit in bytes>}) db.adminCommand({setParameter: 1, internalQueryExecMaxBlockingSortBytes: 330000554432})
OperationFailed: Sort operation used more than the maximum XXX bytes of RAM. Add an index, or specify a smaller limit.
The default value is 32MiB (33554432 bytes) and should be adjusted with
care – large in-memory sorts can cause your database to grind to a halt (which is why there was a limit in the first place).
OperationFailed: Sort operation used more than the maximum XXX bytes of RAM. Add an index, or specify a smaller limit.
https://askubuntu.com/questions/501937/how-to-increase-buffered-data-limit