Sort in multiple fields aggregate

Did you tried passing {allowDiskuse:true} option in aggregation??

|allowDiskUse|boolean|Optional. Enables writing to temporary files. When set to true , aggregation stages can write data to the _tmp subdirectory in the dbPath directory.

Starting in MongoDB 4.2, the profiler log messages and diagnostic log messages includes a usedDisk indicator if any aggregation stage wrote data to temporary files due to memory restrictions.|
| — | — |