目录

连接数据库
对应路径下cmd中输入命令mongo即可

插入数据
j={name:"mongo"}
t={x:3}
提交:db.things.svae(j);db.things.svae(t);
查询:db.things.find();

for循环插入数据
for (var i=1; i<10; i++) db.things.save({x:4,j:i});

每次插入数据都会生成一个ID ("_id")
根据条件查询
db.things.findOne({name:"mongo"});

修改数据
修改mongo为mongo_new
db.things.update({name:"mongo"},{$set:{name:"mongo_new"}});

删除数据
删除mongo_new
db.things.remove({name:"mongo_new"});

更多具体操作可以借鉴我上传的文档数据进行预览实现。