0 0
Read Time:24 Second

Create a New Database and Collection

To create a new database, issue the use <db> command with the database that you would like to create. For example, the following commands create both the database myNewDatabase and the collection myCollection using the insertOne() operation:

use myNewDatabase
db.myCollection.insertOne( { x: 1 } );

If a collection does not exist, MongoDB creates the collection when you first store data for that collection.

Happy
Happy
0 %
Sad
Sad
0 %
Excited
Excited
0 %
Sleepy
Sleepy
0 %
Angry
Angry
0 %
Surprise
Surprise
0 %

Average Rating

5 Star
0%
4 Star
0%
3 Star
0%
2 Star
0%
1 Star
0%

Leave a Comment