New to MongoDB , I'm trying to optimize bulk writing to a database. However, I do not understand how to initialize Bulk() operations.
I understand that since the insertions will be performed in the collection, this is where (or rather "what") the initializeUnorderedBulkOp() should be initialized:
The code below describes all the cases that I can think of:
import pymongo conn = pymongo.MongoClient('mongodb.example.com', 27017) db = conn.test coll = db.testing
The exception is
TypeError: 'Collection' object is not callable. If you meant to call the 'initializeUnorderedBulkOp' method on a 'Database' object it is failing because no such method exists.
with 'Database' for the first case and 'Collection' for the last two
How to use initializeUnorderedBulkOp() ?
source share