时间:2021-07-01 10:21:17 帮助过:5人阅读
mongodb插入数据及其他语句 插入数据: [javascript] db.mycollection.insert({name:BuleRiver}); 查找: [javascript] db.mycollection.find({name:BuleRiver}); db.mycollection.findOne({name:BuleRiver}); 删除 [javascript] db.mycollection.remove();
mongodb插入数据及其他语句
插入数据:
[javascript]
db.mycollection.insert({"name":"BuleRiver"});
查找:
[javascript]
db.mycollection.find({"name":"BuleRiver"});
db.mycollection.findOne({"name":"BuleRiver"});
删除
[javascript]
db.mycollection.remove();
db.mycollection.remove({"name":"BuleRiver"});
更新:
[javascript]
db.mycollection.update({"name":"BuleRiver"}, {"name":"BuleRiver2"});