连接mongo数据库:
进入到mongodb的目录执行./mongo host:port
数据查找:
db.user.find({'account':'abc'})
数据删除:
db.user.remove({'account':'abc'})
查看索引:
db.user.getIndexes();
删除索引:
db.user.dropIndex('account');
使用索引:
db.user.ensureIndex({'account':1},{unique:true});