Create a collection command for MongoDB db. createCollection
Create a collection command for MongoDB db. createCollection
The complete command is as follows:Db. createCollection (name, {capped:
, AutoIndexId:
, Size:
, Max
Common mongodb shell
> Use cmd_test // create a database switched to db cmd_test> db. createCollection ("test") // create a table is the collection {"OK": 1}> db. db. addUser (db. group (db. adminCommand (db. groupcmd (db. auth (db. groupeval (db.
MongoDB database OverviewMongoDB is a high-performance, open-source, and non-pattern document-type database. It can be used in many scenarios to replace the traditional relational database or key/value storage mode. MongoDB is developed in C ++
Common shell for mongodb and mongodbshell
> Use cmd_test // create a database
Switched to db pai_test
> Db. createCollection ("test") // create a table as a set.
{"OK": 1}
> Db.
Db. addUser (db. group (
Db. adminCommand (db. groupcmd (
Db. auth (db.
View all data tables> Use ChatRoomSwitched to db ChatRoom> Show collectionsAccountChatSystem. indexesSystem. users Create a data table> Db. createCollection ("Account "){"OK": 1} > Db. createCollection ("Test", {capped: true, size: 10000}) {"OK": 1}{
If you have never been familiar with MongoDB or have a little understanding of MongoDB, if you are a C # developer, take a few minutes to read this article. This article will take you step by step to get started easily. Read directory 1:
MongoDB Learning (2) Visual Interface and mongodb Visualization1. Installation visual interface 1. mongobooster installation and configuration 1. Download and install
: Https://nosqlbooster.com/downloads
After the download is complete, click Install:
After MongoDB is started successfully, open a command line window and enter mongo to perform database operations. Enter help to see the basic operation command: showdbs: display the Database List showcollections: display the set in the current
Comparison between MongoDB and MySQL commands
Traditional relational databases are generally composed of three levels: database, table, and record. MongoDB is composedDatabase, collection, and document)Three layers. MongoDB has no concept of columns,
The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion;
products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the
content of the page makes you feel confusing, please write us an email, we will handle the problem
within 5 days after receiving your email.
If you find any instances of plagiarism from the community, please send an email to:
info-contact@alibabacloud.com
and provide relevant evidence. A staff member will contact you within 5 working days.