allowDiskUse property
Enables writing to temporary files. When set to true, a ggregation 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.
Implementation
bool allowDiskUse;