While running the query
[[{“$sort”:{“distance”:1,“price”:-1}},{“$unset”:[“src”,“cms”,“dealer.email”,“dealer.locations”,“dealer.unknown”,“associatedDealers”]},{“$project”:{“_id”:1,“listing”:1,“bike_id”:1,“certified”:1,“color”:1,“condition”:1,“created_at”:1,“dealer”:1,“description”:1,“distance”:1,“estimatedPayment”:1,“mileage”:1,“model”:1,“name”:1,“photoUrls”:1,“price”:1,“ridingStyle”:1,“status”:1,“updated_at”:1,“vin”:1,“year”:1}},{“$group”:{“_id”:0,“count”:{“$sum”:1},“document”:{“$push”:“$$ROOT”}}},{“$project”:{“count”:1,“document”:{“$slice”:[“$document”,0,24]}}},{“$unwind”:{“path”:“$document”,“preserveNullAndEmptyArrays”:true}},{“$group”:{“_id”:0,“totalCount”:{“$first”:“$count”},“data”:{“$push”:“$document”}}},{“$limit”:10}]]
getting following exception:
push used too much memory and cannot spill to disk. Memory limit: 104857600 bytes - {“operationTime”:“7088681554536300545”,“ok”:0,“code”:146,“codeName”:“ExceededMemoryLimit”,“$clusterTime”:{“clusterTime”:“7088681554536300545”,“signature”:{“hash”:“xRoNutf0Qj3coUPQWZjGUmyDzW8=”,“keyId”:“7035637553084497921”}},“name”:“MongoError”}