Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- def write_data(documents, collection_name):
- # when running locally
- #client = pymongo.MongoClient("localhost", 3001)
- #db = client.meteor
- # on the server
- client = MongoClient(mongoURL, username=****,
- password=****)
- db = client.mercurius
- if collection_name in db.collection_names():
- collection = db[collection_name]
- collection.drop()
- new_collection = db[collection_name]
- new_collection.insert_many(documents)
- cursor = new_collection.find({})
- for document in cursor:
- print(document)
- Meteor.call( 'getDBinfo', function(err, response){
- console.log(response);
- console.log(err);
- });
Add Comment
Please, Sign In to add comment