MongoDB collection operation

MongoDB collection operation

Create Collection

db.createCollection(name, options)
  • name: the name of the collection to be created
  • options: An optional parameter specifying the relevant memory size and index options

Here Insert Picture Description

View existing collection

show collections  

show tables

Here Insert Picture Description

When directly create documents, collections will be automatically created

Delete Collection

db.collection.drop()

Here Insert Picture Description

Published 121 original articles · won praise 189 · views 10000 +

Guess you like

Origin blog.csdn.net/qq_45163122/article/details/104750028