Skip to content

Instantly share code, notes, and snippets.

@romuloctba
Forked from cristopher-rodrigues/randdata.js
Created June 10, 2016 16:40
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save romuloctba/8c097db57bbe09470317e12a063def99 to your computer and use it in GitHub Desktop.
Save romuloctba/8c097db57bbe09470317e12a063def99 to your computer and use it in GitHub Desktop.
mongo random find data
db.collection.find().limit(1).skip(_rand()*db.collection.count());
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment