MongoDB 创建简单索引

简单索引

# 格式
db.collection.createIndex({key: option})	

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

posted @ 2021-09-09 08:47  黑白吖  阅读(151)  评论(0编辑  收藏  举报
TOP