尝试这个:
var myCursor = collection.find({}).cursor({batchSize:50});
myCursor.eachAsync((doc) => {
...
});
Run Code Online (Sandbox Code Playgroud)
批量大小仅用于性能优化,不会为您提供 50 个对象块。
您仍然需要单独处理每个文档。
| 归档时间: |
|
| 查看次数: |
9701 次 |
| 最近记录: |