环境: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.

 

相关文章:

  • 2021-10-21
  • 2021-06-13
  • 2021-07-04
猜你喜欢
  • 2022-12-23
  • 2022-01-06
  • 2021-05-23
  • 2021-06-29
  • 2021-12-10
  • 2021-05-14
相关资源
相似解决方案