{ "_id" : ObjectId("5bd6c4f3c3474d25ef31e224"), "unique_charcter" : [ "FqT9lRq7wdoSqjbfvQALU7mf4R0M" ], "name" : "-_2017-2018.3-14.pdf" }
{ "_id" : ObjectId("5bd6c4f3c3474d25ef31e225"), "unique_charcter" : [ "FoofNrPnYIIZVsyj65XUVUvjTR1Z" ], "name" : "-201810-25.pdf" }
{ "_id" : ObjectId("5bd6c4f3c3474d25ef31e226"), "unique_charcter" : [ "FgU-MGyutFQW3DOIZGbo3wWQHp72" ], "name" : "-_2017-2018.3-16.pdf" }
{ "_id" : ObjectId("5bd6c4f3c3474d25ef31e227"), "unique_charcter" : [ "lqlGn1hLyW_-waylmX1LEACcYlgu" ], "name" : "-2018-38.pdf" }
{ "_id" : ObjectId("5bd6c4f3c3474d25ef31e228"), "unique_charcter" : [ "lvde7RfjUU3cB47wMp4ZXWbaTduu" ], "name" : "-2017-110.pdf" }
{ "_id" : ObjectId("5bd6c4f3c3474d25ef31e229"), "unique_charcter" : [ "FlvvOS5Ezs1OoWs0s6Mg_zNMujsc" ], "name" : "--2018.3-15.pdf" }
{ "_id" : ObjectId("5bd6c4f3c3474d25ef31e22a"), "unique_charcter" : [ "FpRF3bsFmE-h1c0HPn7dAu3B8Usy" ], "name" : "-20182app:-2018.3-31.pdf" }
{ "_id" : ObjectId("5bd6c4f3c3474d25ef31e22b"), "unique_charcter" : [ "FuSlMQSZyMHootmuSoT3y4MKSs7x" ], "name" : "-app-2018.3-13.pdf" }
add index and insert
key_word = {"unique_charcter": unique_charcter [0], "name": item ["name"]}
self.xiaoMiQuanCollection.ensureIndex (key_word)
res = self.xiaoMiQuanCollection.find (key_word)
the code after adding the index is as follows
key_word = {"unique_charcter": unique_charcter [0], "name": item ["name"]}
index=self.xiaoMiQuanCollection.createIndex ({key_word:1})
res = self.xiaoMiQuanCollection.find (index)