您好, 欢迎来到 !    登录 | 注册 | | 设为首页 | 收藏本站

春季-mongodb-聚合-需要'cursor'选项

春季-mongodb-聚合-需要'cursor'选项

从文档。

MongoDB 3.4不建议使用不带游标选项的聚合命令,除非管道包括解释选项。使用聚合命令以内联方式返回聚合结果时,请使用认批处理大小游标:{}指定游标选项,或在游标选项游标:{batchSize:}中指定批处理大小。

你可以通过batchSizeAggregationOptions在春季蒙戈2.x版

Aggregation aggregation = newAggregation(unwind, group).withOptions(newAggregationOptions().cursorBatchSize(100).build());

使用认批次大小

Aggregation aggregation = newAggregation(unwind, group).withOptions(newAggregationOptions().cursor(new Document()).build());
mongodb 2022/1/1 18:30:31 有575人围观

撰写回答


你尚未登录,登录后可以

和开发者交流问题的细节

关注并接收问题和回答的更新提醒

参与内容的编辑和改进,让解决方法与时俱进

请先登录

推荐问题


联系我
置顶