[JAVA-1140] DBCursor.hasNext malfunctioned with complex query and batchSize specified Created: 07/Mar/14  Updated: 11/Sep/19  Resolved: 08/Mar/14

Status: Closed
Project: Java Driver
Component/s: API, Query Operations
Affects Version/s: 2.11.1
Fix Version/s: None

Type: Task Priority: Minor - P4
Reporter: John Doe Assignee: Unassigned
Resolution: Done Votes: 0
Labels: driver
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

server version: 2.4.3



 Description   

when we issue a complex query with batchSize (50)
the result should be return 200 records,
and DBCursor.size() return the same

but, while loop break after 50 times loop
while(cursor.hasNext()) {
cursor.next();
// do something...
}

if we leave batchSize unspecfied, then cursor.hasNext() works fine

is this a bug or limitation ?

complex query:
{ "$and" : [

{ "Level" : 8}

,

{ "Visible" : true}

, { "Status" : { "$ne" : "DELETED"}} ,

{ "VersionId" : -1}

, { "PositionIds" : { "$in" : [ 12]}}]}



 Comments   
Comment by Githook User [ 12/Mar/14 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-1140: Temporarily disabling an ordered bulk write test for reporting of both write errors and write concern errors
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/a4ea6e46950dba26f5e5923d236aa4d32c4ca3f3

Comment by Githook User [ 12/Mar/14 ]

Author:

{u'username': u'jyemin', u'name': u'Jeff Yemin', u'email': u'jeff.yemin@10gen.com'}

Message: JAVA-1140: Implemented BulkWriteError.toString
Branch: master
https://github.com/mongodb/mongo-java-driver/commit/efdb9dda10cb24c180b2e9a079c02059f07b3f3f

Comment by Jeffrey Yemin [ 08/Mar/14 ]

Hi John,

Thanks for doing the additional research to figure out the root cause. I'm going to close this issue since there's nothing we can do in the JAVA driver to address it.

Comment by John Doe [ 08/Mar/14 ]

seems the problem cause by https://jira.mongodb.org/browse/SERVER-7267

Generated at Thu Feb 08 08:53:53 UTC 2024 using Jira 9.7.1#970001-sha1:2222b88b221c4928ef0de3161136cc90c8356a66.