Skip to content

Instantly share code, notes, and snippets.

@jeffgca
Created February 25, 2011 21:10
Show Gist options
  • Save jeffgca/844500 to your computer and use it in GitHub Desktop.
Save jeffgca/844500 to your computer and use it in GitHub Desktop.
From boxed ice, how to get the last oplog date.
/* Choosing the right MongoDB oplog size can be difficult, especially if your usage is growing. So here’s quick way to see what the last item in the oplog is. If your down slave or backup is older that this, it won’t be able to resync: */
use local
new Date(db.oplog.rs.find().sort({$natural:1}).limit(1).next()["ts"]["t"])
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment