1. getLastErrordb.runCommand({getLastError:1})2. buildInfo //返回mongoDB的服务器版本号和操作系统类型db.runCommand({"buildInfo":1})3.collStats //返回集合的统计信息db.runComma... Read More
posted @ 2015-09-09 14:56 麻木鲁克 Views(492) Comments(0) Diggs(0)
//创建索引db.web.ensureIndex({"id":1,"age":-1}) //为id添加索引 id为升序 age为降序//自定义索引名称db.web.ensureIndex({"id":1},{"name":"idIndex"})//唯一索引db.web.ensureIndex({"... Read More
posted @ 2015-09-09 13:59 麻木鲁克 Views(194) Comments(0) Diggs(0)