Skip to content

Instantly share code, notes, and snippets.

@danared
Created February 12, 2016 16:52
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 danared/23d44ab9f41d4ae0fcb1 to your computer and use it in GitHub Desktop.
Save danared/23d44ab9f41d4ae0fcb1 to your computer and use it in GitHub Desktop.
number_of_documents = 100
load_data(collection, number_of_documents )
query = {'i': random.randint(0, 10 ) }
docs = [x for x in collection.find(query)]
winner = random.sample(docs, 1)[0]
print "AND THE WINNER IS ..... " + winner['name']
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment