Advertisement
Guest User

Untitled

a guest
Feb 19th, 2020
82
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Python 0.28 KB | None | 0 0
  1. import json
  2. from pymongo import MongoClient
  3.  
  4. client = MongoClient('localhost', 12345)
  5. db = client['er_db']
  6. collection_currency = db['er_collection']
  7.  
  8. with open('some_json.json') as f:
  9.     file_data = json.load(f)
  10.  
  11. collection_currency.insert_many(file_data)
  12.  
  13. client.close()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement