Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from mongate.connection import Connection
- connection = Connection(
- 'example.com',
- 27080,
- https=True,
- auth=True,
- username='auth_username',
- password='auth_password'
- )
- connection.connect_to_mongo('localhost', 27017)
- db = connection.database_name
- collection = db.collection_name
- batch = Batch(collection, connection)
- batch.add_insert({
- 'batch_insert_1': 3,
- 'bar': 2
- })
- batch.add_insert({
- 'batch_insert_2': 'banana',
- 'banana': 'apple'
- })
- batch.add_insert({
- 'batch_insert_3': 29,
- 'bar': 2
- })
- batch.execute()
Add Comment
Please, Sign In to add comment