pymongo创建索引

from database import db
db_list = ["table1", "table2", "table3", "table4"]
for item in db_list:
    collection = db[item]
    collection.create_index([("phone", 1)])
    print(list(collection.index_information()))
原文地址:https://www.cnblogs.com/c-x-a/p/9836501.html