Did you set the option via " `spark.mongodb.read.aggregation.allowDiskUse" or just “aggregation.allowDiskUse” ?