Skip to content

Instantly share code, notes, and snippets.

@peterzawistowicz
Created May 27, 2015 21:11
Show Gist options
  • Save peterzawistowicz/6ee99b4cc8c9820c57ee to your computer and use it in GitHub Desktop.
Save peterzawistowicz/6ee99b4cc8c9820c57ee to your computer and use it in GitHub Desktop.
db.activity.find({ userId: “u123”,
ts: {“$g”t:1301284969946, // time bound the query
“$lt”: 1425657300} })
.sort({ time: -1 }).limit(100) // sort in desc order
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment