Optimization Mongo SpringData findAll是否支持批量抓取

Optimization Mongo SpringData findAll是否支持批量抓取,optimization,batch-processing,spring-data-mongodb,Optimization,Batch Processing,Spring Data Mongodb,我有SOLR feeding mechanizm,它从mongo base获取所有订单并进行处理(获取额外数据并创建SOLR文档)。 我的问题是记录的数量超过了100k,所以将它们全部提取到一个列表中并进行处理是错误的 SpringData能否支持批处理列表查询?这样我就可以处理更小的数据块并处理它们了 我可以这样工作: interface Command { /* Here I will define logic that transforms mongo entry list into

我有SOLR feeding mechanizm,它从mongo base获取所有订单并进行处理(获取额外数据并创建SOLR文档)。 我的问题是记录的数量超过了100k,所以将它们全部提取到一个列表中并进行处理是错误的

SpringData能否支持批处理列表查询?这样我就可以处理更小的数据块并处理它们了

我可以这样工作:

interface Command {
/*
 Here I will define logic that transforms mongo entry list
 into SOLR documents and sends an update
*/
  void execute(List<D> input); // here I will put my logic
}
Command commandExecutor = ...;//implement Executor
int batchSize = 500;
mongoTemplate.findAll(MyModel.class, commandExecutor , batchSize );