Skip to content

@avelino /mongodb.py
Created

Embed URL

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Inset 1000000 records in MongoDB via Python
#!/usr/bin/env python
# -*- coding: utf-8 -*-
from pymongo import MongoClient
connection = MongoClient()
db = connection.test
persons = db.persons
for i in range(0, 1000000):
person = persons.insert({'name': 'Thiago Avelino %d' % i,
'age': 18+i,
'language': ['python'],})
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.