Introducing a Local Experience for Atlas, Atlas Search, and Atlas Vector Search with the Atlas CLI

Shelby Carpenter and Jakub Lazinski

This post is also available in: Deutsch, Français, Español, Português.

Today, MongoDB is pleased to announce in Public Preview a new set of features for building software locally with MongoDB Atlas, giving developers greater flexibility and reducing operational overhead throughout the entire software development lifecycle.

Developers can now develop locally with MongoDB Atlas deployments, including Atlas Search and Vector Search, using the Atlas CLI, empowering them to create full-text search or AI-powered applications no matter their preferred environment for building with MongoDB.

Developers can use the Atlas CLI to set up, connect to, and automate common management tasks from early development through testing, staging, and production. For full-text search use cases, developers can now use the Atlas CLI to create and manage Atlas Search indexes regardless of whether they are working locally or in the cloud. Similarly, developers building applications powered by semantic search and generative AI on MongoDB can now use the Atlas CLI to create and manage local development instances with Vector Search indexes regardless of their development environment.

Developer time is one of the most precious commodities in any organization building innovative new application experiences. But all too frequently, developers are burdened with managing repeatable tasks such as setting up development environments. They also often have to wrestle with the cognitive overhead of switching between different user experiences for local versus cloud development, distracting from delivering value. By giving developers the power of Atlas at their fingertips no matter their preferred development environment, MongoDB continues to expand the scope and capabilities of its developer data platform while placing a premium on developer experience.

Create a Local Atlas Database

Ready to create a local Atlas database, but don’t have the Atlas CLI yet? It’s easy to install with your favorite package manager.

To install the Atlas CLI with Homebrew, use the following command:

brew install mongodb-atlas

In addition to installing via the Homebrew package manager, you can install the MongoDB Atlas CLI via Apt, Yum, Chocolatey, directly downloading the binary, or pulling the Docker image (learn more about our documentation). You can also download it directly from the MongoDB Download Center.

To create a local Atlas deployment with default settings in interactive mode, enter:

atlas deployments setup --type local

If you want to list your Atlas deployments enter:

atlas deployments list

If you’re authenticated to Atlas, you will see both your local and cloud Atlas deployments. If you aren’t authenticated to Atlas, you will only see your local deployments.

Get Started with Local Atlas Search

Building an application with a full-text search feature powered by Atlas Search? If you’re a developer who tends to build and prototype locally, you may be interested in using the Atlas CLI to work with Atlas Search in your local environment.

To get started, first, connect to the local deployment on which you’d like to create a Search index:

atlas deployments connect

Next, you can use the MongoDB Shell to create your Search index. Below you’ll see an example of how to create an Atlas Search index:

db.YOURCOLLECTION.createSearchIndex(
    "example-index",
    { mappings: { dynamic: true } }
)

Then, if you want to run a query you can use the $search stage of an aggregation pipeline. You can learn more about managing Atlas Search indexes in our documentation.

Get Started with Local Vector Search

If you’re building an application with generative AI or semantic search and MongoDB Atlas, chances are you’ll be interested in our Atlas Vector Search offering. And now with the Atlas CLI, you can work with Vector Search in the cloud and your local environment.

To get started with Vector Search locally you can use MongoDB Shell to create a Vector Search index. Notice that this is similar to the Atlas Search example above, except that in this case there is a vector embedding accounted for in search index creation.

db.YOURCOLLECTION.createSearchIndex({
  "mappings": {
    "dynamic": true,
    "fields": {
      "plot_embedding": {
        "type": "knnVector",
        "dimensions": 1536,
        "similarity": "euclidean"
      }
    }
  }
}
)

To learn more about running Vector Search queries visit our documentation.

Additionally, if you're already familiar with handling your cloud Search indexes using the Atlas CLI, you'll appreciate a fresh set of interactive commands designed to help you efficiently manage Atlas Search and Vector Search indexes both locally and in the cloud:

atlas deployments search indexes create 

From there you can move through an interactive flow that guides you through index creation. For detailed instructions visit our tutorial.

Ready to Move to the Cloud?

If you’re ready to create an Atlas database in the cloud, that is easy to do with the Atlas CLI. Simply use the following command:

atlas deployments setup --type atlas

From there, the setup wizard will guide you to:

  • Register for an Atlas account or authenticate to an existing account

  • Create a free MongoDB Atlas database

  • Load sample data

  • Add your IP address to the access list

  • Create a database user and password

  • Connect to the cluster using the MongoDB Shell (mongosh) so you can begin interacting with your data

To learn more about the Atlas CLI, visit our documentation. And be sure to let us know what you think of the Atlas CLI in our user feedback portal.

With the new local experience with the Atlas CLI, it’s easier than ever to work with your data on Atlas no matter your preferred development environment. Get started today with the Atlas CLI as the ultimate developer tool to manage MongoDB Atlas, including Atlas Search and Vector Search, throughout the entire software development lifecycle, from your local environment all the way to the cloud.