【进击后端】mongodb入门

环境:ubuntu

重要字:数据库,集合,记录,字段

api地址:https://docs.mongodb.com/manual/reference/method/db.collection.updateOne/

01.apt install mongodb

02.find / -name mongo

03.cd /usr/bin

04.mongo

05.db

06.use myNewDatabase

07.db.alist.insertOne({ '_id' : '1',name : 'zhangsan' })

08.show collections

09.db.alist.find()

10.db.alist.deleteOne({ '_id' : 1 })

11.db.alist.find()

12.db.alist.insertOne({ '_id' : 3, name : 'wangwu' })

13.db.alist.update({ '_id' : 3 }, { name : 'wangwu2' })

14.db.alist.find()

15.

原文地址:https://www.cnblogs.com/iloveyou-sky/p/7264478.html