-
Type: Bug
-
Resolution: Won't Fix
-
Priority: Major - P3
-
None
-
Affects Version/s: 2.11.1
-
Component/s: API
-
None
It is not allowed on DBCursor.addOption, but it is on DBCursor.setOption. Here's what happens if you use it:
import com.mongodb.*
import java.net.UnknownHostException;
public class ExhaustTest {
public static void main(String[] args) throws UnknownHostException {
MongoClient client = new MongoClient();
DBCollection coll = client.getDB("test").getCollection("CS6843");
for (int i = 0; i < 100000; i++)
DBCursor cursor = coll.find();
cursor.setOptions(Bytes.QUERYOPTION_EXHAUST);
cursor.toArray(10000);
}
}
Exception in thread "main" com.mongodb.MongoException: ids don't match at com.mongodb.DBTCPConnector.innerCall(DBTCPConnector.java:246) at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:216) at com.mongodb.DBTCPConnector.call(DBTCPConnector.java:184) at com.mongodb.DBApiLayer$Result._advance(DBApiLayer.java:430) at com.mongodb.DBApiLayer$Result.hasNext(DBApiLayer.java:399) at com.mongodb.DBCursor._hasNext(DBCursor.java:464) at com.mongodb.DBCursor._fill(DBCursor.java:518) at com.mongodb.DBCursor.toArray(DBCursor.java:553)
- related to
-
JAVA-808 Support the Exhaust flag on query
- Closed