DEV Community

Andrew Kwizera
Andrew Kwizera

Posted on

Mongodb Lessons

This week i learned about mongodb, different commands that can be used in the mongodb shell (mongosh). for example;
show dbs //for showing databases
use <name_of_database> //to switch to a specific database
show collections //displays collections in the database
db.user.insertOne({"name": Jack}) //inserts one document to user collection
db.user.find({}) //to retrieve all documents in the user's collection

Top comments (0)