"failing because no such method exists." % self.__name.split(".")[-1] TypeError: 'Collection' object is not callable. If you meant to call the 'insert' method on a 'Collection' object it is failing because no such method exists.
from pymongo import MongoClient client = MongoClient() db = client.test_database # use a database called "test_database" collection = db.files # and inside that DB, a collection called "files" f = open('hashes.txt') # open a file # build a document to be inserted text_file_doc = {"file_name": "hashes.txt"} # insert the contents into the "file" collection collection.insert(text_file_doc) What I have tried: i have tried above code .but got errors i aslo tried it with insert_one and insert_many but still errors.
var
This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)