简体   繁体   English

Java中的parallelScanning mongodb DBCollection时指定查询条件

[英]specify query conditions when parallelScanning mongodb DBCollection in Java

I need to get a large DBCollection to the memory. 我需要将一个较大的DBCollection放入内存。 Since DBCollection.find() is not working, I used DBCollection.parallelScan() to achieve this. 由于DBCollection.find()无法正常工作,因此我使用DBCollection.parallelScan()来实现这一点。 But in parallelScan I can't specify a query condition like in DBCollection.find(query) . 但是在parallelScan中,我无法像DBCollection.find(query)那样指定查询条件。

Is it possible to use query BasicDBObject in parallelScan ? 是否可以在parallelScan使用查询BasicDBObject

find() will batch the query results. find()将批处理查询结果。 By default, the batch size is 20 documents so it's pretty unlikely that find() is the culprit. 默认情况下,批处理大小为20个文档,因此find()不太可能是罪魁祸首。 You're likely holding on to too much data in your application. 您可能会在应用程序中保留太多数据。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM