Skip to content

Instantly share code, notes, and snippets.

@danared danared/randomdocs
Created Feb 12, 2016

Embed
What would you like to do?
def load_data(collection, n=100):
#for each element we will insert the `i` value
for i in xrange(n):
name = ''.join(random.sample( string.letters, 20))
collection.insert( {'name': name, 'i': i})
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.