Skip to content

Instantly share code, notes, and snippets.

@glasser
Last active June 8, 2016 06:10
Show Gist options
  • Save glasser/69c01c00e6c4e36432c94c0613a95d63 to your computer and use it in GitHub Desktop.
Save glasser/69c01c00e6c4e36432c94c0613a95d63 to your computer and use it in GitHub Desktop.
oplog query for medium post
mongo> use local
mongo> db['oplog.rs'].find({ns: "prod.containers", "o2._id": "3KzZFpTRgt8NusfXo-q26j",
ts: {$gt: Timestamp(1457709700,0)}}).addOption(8).batchSize(1)
{ "ts" : Timestamp(1457709761, 4), "h" : NumberLong("6712804481729067037"), "v" : 2,
"op" : "u", "ns" : "prod.containers", "o2" : { "_id" : "3KzZFpTRgt8NusfXo-q26j" },
"o" : { "$set" : { "status" : "unhealthy" } } }
{ "ts" : Timestamp(1457709773, 3), "h" : NumberLong("-4571029055905183909"), "v" : 2,
"op" : "u", "ns" : "prod.containers", "o2" : { "_id" : "3KzZFpTRgt8NusfXo-q26j" },
"o" : { "$set" : { "status" : "healthy" } } }
{ "ts" : Timestamp(1457709854, 131), "h" : NumberLong("-1797464606787002322"), "v" : 2,
"op" : "u", "ns" : "prod.containers", "o2" : { "_id" : "3KzZFpTRgt8NusfXo-q26j" },
"o" : { "$set" : { "status" : "unhealthy" } } }
@ahmetb
Copy link

ahmetb commented Jun 8, 2016

you could be getting syntax highlighting if you had saved this as .json

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