MongoDB operation instruction in common

MongoDB operation instruction in common

  • 1. mongodStart services mongoto enter the command mode
  • 2. The show dbsdisplay says some database
    Here Insert Picture Description
  • 3.db view the database of the current operation

Here Insert Picture Description

  • 4.use switch the current operation of the database without this database will be created
  • Here Insert Picture Description
  • 5.db. set (analogous to a relational database table) .insertOne () is inserted into a data
    Here Insert Picture Description
  • db. collection .find () all data found in this collection
    Here Insert Picture Description
    collection of two-dimensional table ===

=== document database
only need to specify where to insert the data, you do not need to manually building a database built form

find()
findOne()
save()

Published 84 original articles · won praise 204 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_44983621/article/details/104578435