diff options
Diffstat (limited to 'client/dbclientcursor.h')
-rw-r--r-- | client/dbclientcursor.h | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/client/dbclientcursor.h b/client/dbclientcursor.h index 5d795f4..d176b89 100644 --- a/client/dbclientcursor.h +++ b/client/dbclientcursor.h @@ -86,6 +86,11 @@ namespace mongo { WARNING: no support for _putBack yet! */ void peek(vector<BSONObj>&, int atMost); + BSONObj peekOne(){ + vector<BSONObj> v; + peek( v, 1 ); + return v.size() > 0 ? v[0] : BSONObj(); + } /** iterate the rest of the cursor and return the number if items |