Mongodb always says that there is no createindex method for indexing.

index = self.xiaoMiQuanCollection.createIndex ({"unique_charcter": 1, "name": "hashed"}, {"unique": True})
res = self.xiaoMiQuanCollection.find (index)

TypeError: "Collection" object is not callable. If you meant to call the "createIndex" method on a" Collection" object it is failing because no such method exists.

I am also wrong to write ensureIndex, ask for advice-sharp-sharp-sharp topic description

Sep.30,2021

What is the type of

self? Unless self inherits database, it will not fetch collection directly. Even then, the syntax should be self ["xiaoMiQuanCollection"] .createIndex (.)

first take a look at the basic operations of documentation: python/current/tutorial.html" rel=" nofollow noreferrer "> http://api.mongodb.com/python.

. If

pymongo, it is the create_index method
python/current/tutorial.html" rel=" nofollow noreferrer "> pymongo document link

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1e9cdef-69080.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1e9cdef-69080.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?