# 格式 db.collection.createIndex({key: option}) # 示例:给 xx 集合中的 insert_time 添加索引,1升序,-1降序 db.xx.createIndex({"insert_time": 1})