MongoDB EventJoin us at MongoDB.local London on Oct 7 to unlock new possibilities for your data. Use WEB50 to save 50%. Learn more >
BlogInnovate for the AI Era: Get the latest MongoDB.local NYC 2025 news and updates! Read the blog >
NewModernize 2-3x faster with MongoDB’s AI-powered Application Modernization Platform. Learn more >
NewSearch & Vector Search now in public preview for Community Edition Read the blog >

TOOLS

MongoDB Shell (mongosh)

An interactive tool for data manipulation (CRUD), advanced querying (pipelines), and management of users, data replication, and scaling.

Download NowRead the docs
Illustration of data exploration and querying datasets

Interact with your data

Connect to your MongoDB cluster to view data, perform CRUD operations, run and test queries, and execute aggregation pipelines for efficient server-side data processing.

Learn about CRUD commands
An example of using MongoDB Shell to connect Atlas to MongoDB.
Illustration of

Manage users, replication, and scaling

Use MongoDB Shell (mongosh) to manage database users, configure data replication for high availability, and scale horizontally with sharding.

Configure MongoDB Shell

Use scripts to automate common tasks

Write scripts in the MongoDB Shell (mongosh) to automate data modifications, like bulk-updating documents, and administrative tasks, like checking index usage. For easy distribution and reuse, you can also package your scripts as snippets.

Learn to write scripts
Illustration that represents scripts to automate common tasks
Illustration of data exploration and querying datasets

Use on its own or in MongoDB Compass

Download MongoDB Shell (mongosh) as a standalone tool to run in your terminal, or access it directly within Compass, MongoDB's official GUI.

Learn more

Interact with your database programmatically

Use simple commands to manipulate data, run advanced queries, and manage users, data replication, and scaling.

Perform CRUD operations

Create, read, update, and delete data using simple commands.

See how
Insert data
Query data
Update data
Delete data

Run aggregation pipelines

You can filter, group, sort, and calculate new fields, then view the aggregated results directly in your terminal.

Learn how
Aggregation Pipeline

Automate tasks with scripts

Create scripts to automate common data manipulation or administrative tasks. For example, make data changes in bulk for a discontinued product line, or assign security and access rights to a new user. 

See how
Write scripts

Learning hub


FAQ

Interact with your database programmatically

The MongoDB Shell (mongosh) is a JavaScript and Node.js REPL environment for interacting with MongoDB deployments in Atlas, locally, or on another remote host.
Download Shell
GET STARTED NOW
  • Perform CRUD operations
  • Execute Aggregation Pipelines
  • Manage Databases and Collections
  • Administer Servers
  • Manage access and security