Skip to content

Instantly share code, notes, and snippets.

@danared
Created February 12, 2016 16:49
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/cae6e85a861bd988b5eb to your computer and use it in GitHub Desktop.
Save danared/cae6e85a861bd988b5eb to your computer and use it in GitHub Desktop.
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