summaryrefslogtreecommitdiff
path: root/db/dbcommands.cpp
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2010-08-18 09:23:15 +0200
committerAntonin Kral <a.kral@bobek.cz>2010-08-18 09:23:15 +0200
commit3b9581e84e19723087b31b79674801b6c06ae533 (patch)
tree5568dbd7199b1ce64ace1cec26b590c1431e872d /db/dbcommands.cpp
parentd7ec8115ec4b160ed74c1a8a06a1c171d76370ac (diff)
downloadmongodb-3b9581e84e19723087b31b79674801b6c06ae533.tar.gz
Imported Upstream version 1.6.1
Diffstat (limited to 'db/dbcommands.cpp')
-rw-r--r--db/dbcommands.cpp13
1 files changed, 7 insertions, 6 deletions
diff --git a/db/dbcommands.cpp b/db/dbcommands.cpp
index 94edf0a..34d00c8 100644
--- a/db/dbcommands.cpp
+++ b/db/dbcommands.cpp
@@ -1451,17 +1451,18 @@ namespace mongo {
BSONElementSet values;
shared_ptr<Cursor> cursor = bestGuessCursor(ns.c_str() , query , BSONObj() );
+ scoped_ptr<ClientCursor> cc (new ClientCursor(QueryOption_NoCursorTimeout, cursor, ns));
while ( cursor->ok() ){
- if ( cursor->matcher() && ! cursor->matcher()->matchesCurrent( cursor.get() ) ){
- cursor->advance();
- continue;
+ if ( !cursor->matcher() || cursor->matcher()->matchesCurrent( cursor.get() ) ){
+ BSONObj o = cursor->current();
+ o.getFieldsDotted( key, values );
}
- BSONObj o = cursor->current();
cursor->advance();
-
- o.getFieldsDotted( key.c_str(), values );
+
+ if (!cc->yieldSometimes())
+ break;
}
BSONArrayBuilder b( result.subarrayStart( "values" ) );