index = self.xiaomiquan_collection.create_index(
[("unique_charcter", pymongo.DESCENDING), ("name", 1)], unique=True)
res = self.xiaomiquan_collection.find(index)
Traceback (most recent call last):
File "/home/shenjianlin/.local/lib/python3.4/site-packages/twisted/internet/defer.py", line 653, in _runCallbacks
current.result = callback(current.result, *args, **kw)
File "/home/shenjianlin/my_project/Espider/Espider/pipelines/XiaoMiQuanPipelines.py", line 14, in process_item
[("unique_charcter", pymongo.DESCENDING), ("name", pymongo.HASHED)], {"unique": True})
File "/usr/lib64/python3.4/site-packages/pymongo/collection.py", line 1754, in create_index
self.__create_index(keys, kwargs, session, **cmd_options)
File "/usr/lib64/python3.4/site-packages/pymongo/collection.py", line 1656, in __create_index
session=session)
File "/usr/lib64/python3.4/site-packages/pymongo/collection.py", line 245, in _command
retryable_write=retryable_write)
File "/usr/lib64/python3.4/site-packages/pymongo/pool.py", line 484, in command
self.validate_session(client, session)
File "/usr/lib64/python3.4/site-packages/pymongo/pool.py", line 630, in validate_session
if session._client is not client:
AttributeError: "dict" object has no attribute "_client"