Skip to content

Instantly share code, notes, and snippets.

@danared danared/randomdocs
Created Feb 12, 2016

Embed
What would you like to do?
mc = MongoClient()
db = mc.simplerandom
collection = db.names
number_of_documents = 100
load_data(collection, number_of_documents )
query = {'i': random.randint(0, number_of_documents ) }
winner = collection.find_one(query);
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.