摘要: 更新又三个方法: db.collection.updateOne(<filter>, <update>, <options>) db.collection.updateMany(<filter>, <update>, <options>) db.collection.replaceOne(<filt 阅读全文
posted @ 2021-11-03 20:57 aoeiuv 阅读(73) 评论(0) 推荐(0) 编辑
摘要: 删除操作两种,类似插入操作: db.collection.deleteMany() db.collection.deleteOne() 删除所有数据 db.inventory.deleteMany({}) 删除符合条件的数据 db.inventory.deleteMany({ status : "A 阅读全文
posted @ 2021-11-03 20:57 aoeiuv 阅读(130) 评论(0) 推荐(0) 编辑
摘要: 插入单个文档 db.collection.insertOne() db.inventory.insertOne( { item: "canvas", qty: 100, tags: ["cotton"], size: { h: 28, w: 35.5, uom: "cm" } } ) 如果没有指定_ 阅读全文
posted @ 2021-11-03 20:57 aoeiuv 阅读(75) 评论(0) 推荐(0) 编辑
摘要: 帮助命令 Help Methods and Commands Description help 显示帮助信息 db.help() 显示数据库方法的帮助信息 db.<collection>.help() 显示集合上方法的帮助信息。 <collenction>可以是存在的,也可以是瞎写,无所谓 show 阅读全文
posted @ 2021-11-03 20:56 aoeiuv 阅读(41) 评论(0) 推荐(0) 编辑