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()))
posted @ 2018-10-23 14:39  公众号python学习开发  阅读(1603)  评论(0编辑  收藏  举报