Avoid Aggregate 16MB Limit

后端 未结 2 1410
耶瑟儿~
耶瑟儿~ 2020-12-11 07:57

I have a collection of about 1M documents. Each document has internalNumber property and I need to get all internalNumbers in my node.js code.

2条回答
  •  予麋鹿
    予麋鹿 (楼主)
    2020-12-11 08:19

    For Casbah users:

    val pipeline = ...
    collection.aggregate(pipeline, AggregationOptions(batchSize = 500, outputMode = AggregationOptions.CURSOR)
    

提交回复
热议问题