목록2019/01/18 (1)
미니옵빠의 code stubs
MongoDB : Sort exceeded memory limit of 104857600 bytes
mongoDB 에서 aggregate 후 sort 를 할 때 요런 오류 메시지를 만날 때가 있음 MongoDB : Sort exceeded memory limit of 104857600 bytes 아래와 같이 쿼리 내 allowDiskUse 옵션을 추가하여 해결 가능 db.getCollection('hello').aggregate( [ { $project: { "name": 1, "field_length": {$strLenCP: { $ifNull: ["name", "" ]}} } }, {$sort: {"field_length": -1}}, {$project: {"field_length": 0}}, ], {allowDiskUse: true} ) 참고로 Robo3T 에서 Replica Set 에 쿼리 시, ..
Database/MongoDB
2019. 1. 18. 23:03