Skip to content

Instantly share code, notes, and snippets.

@danared danared/randomdocs
Created Feb 12, 2016

Embed
What would you like to do?
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
You can’t perform that action at this time.