summaryrefslogtreecommitdiff
path: root/client/examples/tail.cpp
diff options
context:
space:
mode:
authorAntonin Kral <a.kral@bobek.cz>2011-03-17 00:07:52 +0100
committerAntonin Kral <a.kral@bobek.cz>2011-03-17 00:07:52 +0100
commit98b8b639326ab4c89eed73739d9903993c4c8959 (patch)
tree0462df078bf740093774d033b75f0ea24a31fa97 /client/examples/tail.cpp
parentf5d6e97ca8d2f3e7c4cdd5c9afbf8e756ef65bc2 (diff)
parent582fc32574a3b158c81e49cb00e6ae59205e66ba (diff)
downloadmongodb-98b8b639326ab4c89eed73739d9903993c4c8959.tar.gz
Merge commit 'upstream/1.8.0
Diffstat (limited to 'client/examples/tail.cpp')
-rw-r--r--client/examples/tail.cpp40
1 files changed, 20 insertions, 20 deletions
diff --git a/client/examples/tail.cpp b/client/examples/tail.cpp
index 3738b4f..90e62d2 100644
--- a/client/examples/tail.cpp
+++ b/client/examples/tail.cpp
@@ -23,24 +23,24 @@
using namespace mongo;
void tail(DBClientBase& conn, const char *ns) {
- BSONElement lastId = minKey.firstElement();
- Query query = Query();
-
- auto_ptr<DBClientCursor> c =
- conn.query(ns, query, 0, 0, 0, QueryOption_CursorTailable);
-
- while( 1 ) {
- if( !c->more() ) {
- if( c->isDead() ) {
- break; // we need to requery
- }
-
- // all data (so far) exhausted, wait for more
- sleepsecs(1);
- continue;
- }
- BSONObj o = c->next();
- lastId = o["_id"];
- cout << o.toString() << endl;
- }
+ BSONElement lastId = minKey.firstElement();
+ Query query = Query();
+
+ auto_ptr<DBClientCursor> c =
+ conn.query(ns, query, 0, 0, 0, QueryOption_CursorTailable);
+
+ while( 1 ) {
+ if( !c->more() ) {
+ if( c->isDead() ) {
+ break; // we need to requery
+ }
+
+ // all data (so far) exhausted, wait for more
+ sleepsecs(1);
+ continue;
+ }
+ BSONObj o = c->next();
+ lastId = o["_id"];
+ cout << o.toString() << endl;
+ }
}