Skip to content

Instantly share code, notes, and snippets.

@danared
Last active August 29, 2015 14:18
Show Gist options
  • Save danared/c42a05881c3ebd14bd59 to your computer and use it in GitHub Desktop.
Save danared/c42a05881c3ebd14bd59 to your computer and use it in GitHub Desktop.
1.md

shard01:PRIMARY> c = db.oplog.rs.find( { fromMigrate : { $exists : false } } ).addOption( DBQuery.Option.tailable ).addOption(DBQuery.Option.awaitData) { "ts" : Timestamp(1422998530, 1), "h" : NumberLong(0), "v" : 2, "op" : "n", "ns" : "", "o" : { "msg" : "initiating set" } } { "ts" : Timestamp(1422998574, 1), "h" : NumberLong("-6781014703318499311"), "v" : 2, "op" : "i", "ns" : "test.mycollection", "o" : { "_id" : 1, "data" : "hello" } } { "ts" : Timestamp(1422998579, 1), "h" : NumberLong("-217362260421471244"), "v" : 2, "op" : "i", "ns" : "test.mycollection", "o" : { "_id" : 3, "data" : "hello" } } { "ts" : Timestamp(1422998584, 1), "h" : NumberLong("7215322058367374253"), "v" : 2, "op" : "i", "ns" : "test.mycollection", "o" : { "_id" : 5, "data" : "hello" } } shard01:PRIMARY> c.hasNext() true shard01:PRIMARY> c.next() { "ts" : Timestamp(1423049506, 1), "h" : NumberLong("5775895302295493166"), "v" : 2, "op" : "i", "ns" : "test.mycollection", "o" : { "_id" : 12, "data" : "hello" } } shard01:PRIMARY> c.hasNext() false

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment