daily pastebin goal
78%
SHARE
TWEET

Untitled

a guest Jul 19th, 2018 77 Never
Upgrade to PRO!
ENDING IN00days00hours00mins00secs
 
  1. from mongate.connection import Connection
  2.  
  3. connection = Connection(
  4.     'example.com',
  5.     27080,
  6.     https=True,
  7.     auth=True,
  8.     username='auth_username',
  9.     password='auth_password'
  10. )
  11.  
  12. connection.connect_to_mongo('localhost', 27017)
  13.  
  14. db = connection.database_name
  15. collection = db.collection_name
  16.  
  17. batch = Batch(collection, connection)
  18.        
  19. batch.add_insert({
  20.     'batch_insert_1': 3,
  21.     'bar': 2
  22. })
  23.        
  24. batch.add_insert({
  25.     'batch_insert_2': 'banana',
  26.     'banana': 'apple'
  27. })
  28.        
  29. batch.add_insert({
  30.     'batch_insert_3': 29,
  31.     'bar': 2
  32. })
  33.        
  34. batch.execute()
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top