1、运行命令“db.imooc_collection.getIndexes()”查看集合的索引情况; 2、运行命令“db.imooc_collection.ensureIndex({x:1})”创建索引;