mongoshStarts the modern MongoDB shell and connects using default local settings when available.
Connect with mongosh, switch databases, inspect collections, and run the most common shell workflows.
Create collections and inspect a few starter records.
db.createCollection("users")MongoDB can also create collections implicitly on first insert, but explicit creation is useful for options and predictability.
db.users.insertOne({ name: "Ada", email: "ada@example.com", active: true })A collection will be created automatically if it does not already exist.
db.users.find().limit(5)Limit early while exploring to keep output manageable.
db.users.find({ active: true }).pretty()Useful for ad hoc inspection in interactive sessions.
db.users.drop()Use with care because the operation deletes all documents in the collection.