mirror of
https://github.com/pocoproject/poco.git
synced 2025-02-21 06:37:42 +01:00
Implement the correct way of traversing a cursor
This commit is contained in:
parent
fb94876de2
commit
005e629fc7
@ -319,9 +319,11 @@ void MongoDBTest::testCursorRequest()
|
||||
|
||||
int n = 0;
|
||||
Poco::MongoDB::ResponseMessage& response = cursor.next(_mongo);
|
||||
while(response.cursorID() != 0)
|
||||
while(1)
|
||||
{
|
||||
n += response.documents().size();
|
||||
if ( response.cursorID() == 0 )
|
||||
break;
|
||||
response = cursor.next(_mongo);
|
||||
}
|
||||
std::cout << "n= " << n << std::endl;
|
||||
|
Loading…
x
Reference in New Issue
Block a user