摘要:
查看当前数据库的全部用户>showusers{"_id":ObjectId("4dedeeae26e7516d69948e33"),"user":"libing","readOnly":false,"pwd":"541025c56e577050c3e44efb105e28b6"}>db.system.users.find(){"_id":ObjectId("4dedeeae26e7516d69948e33" 阅读全文
摘要:
查看当前聚集的全部索引>db.Account.getIndexes()[{"name":"_id_","ns":"ChatRoom.Account","key":{"_id":1},"v":0}]创建单列索引>db.Account.ensureIndex({"UserName":1})--1:ASC -1:DESC创建单列唯一索引>db.Account.ensureIndex({"UserName" 阅读全文