sql >> Base de Datos >  >> NoSQL >> MongoDB

MongoDB allowDiskUse no funciona..

Use la consulta agregada en el comando de ejecución, permitirá usar la etiqueta allowDiskUse.

db.runCommand(
   { aggregate: "test",
     pipeline: [
                {$group: {_id: {email: "$email", gender: "$gender"}, cnt: {$sum: 1}}}, 
                {$group: {_id: "$_id.email", cnt: {$sum: 1}}}, 
                {$match: {cnt: 2}}
               ],
     allowDiskUse: true
   }
)