ycsk 发表于 2013-1-30 01:55:17

MongoDB的基本操作

Mongodb启动:
nohup /byread/bin/mongodb/bin/mongod --dbpath=/byread/mongodb 2>&1 >> /byread/logs/mongodb/mongodb.log &
关闭:
db.shutdownServer()
kill -2 PID
kill -15 PID

创建索引
db.things.ensureIndex({j:1});
1升序,-1降序
索引的作用比较大,下面列出索引前和索引后的两个状态,锁表时间大大减少。
<div class="quote_title">引用
页: [1]
查看完整版本: MongoDB的基本操作