Problem scenario
You want to create a database in MongoDB using the CLI. How do you do this from a Linux server and then add a document to the database you just created?
Solution
Prerequisite
Install MongoDB on a Linux server; if you need assistance, see this posting.
Procedures
1.a. Enter the MongoDB shell: /usr/bin/mongo
1.b. If you were able to enter the MongoDB shell, skip directly to step #2. If the command is not found, run this: sudo find / -name mongo | grep bin
1.b.i. Run the file that was found in 1.b.
2. Run a command such as this (but replace "contint" with the new name of a database): use contint
3. Run a command such as this: db.inventory.insertOne( { item: "silk", qty: 35, tags: ["silk"], size: { h: 24, w: 39.5, uom: "in" } } )
4. View the content running a command such as this: db.inventory.find( {} )