Occasionally, you may find yourself in the position where you need to do quick edits on the database. As we mentioned, you can often use the GUI tool MongoDB Compass, however there may be times when you are limited an SSH connection and command line access. The best word of advice we can give you at this point is to brush up on your JavaScript! In this sub-section we will cover creating and dropping databases and collections.
Database and collection operations
Working with databases
Command summary (discussed in the following):
- Create a Database:
use <dbName>;
db.<collection>.insertOne({ // document });
- Drop a Database:
use <dbName>;
db.dropDatabase();
To create a database in MongoDB...