Docs Menu

Docs HomeMongoDB Atlas

Create, View, Drop, and Shard Collections

On this page

  • Required Roles
  • Create a Collection
  • View Collections
  • Drop a Collection
  • Shard a Collection

You can use the Atlas UI to manage the collections in your database deployments.

The following table describes the roles required to perform various actions to a database in the Atlas UI:

Required Role(s)
Create Collections
View Collections
Drop Collections

One of the following roles:

Shard Collections

One of the following roles:


To create the first collection in a new database, see Create a Database.


You cannot create new collections on the config and system databases. Atlas will deprecate writing to existing collections on these databases in the near future.

To create a collection in an existing database through the Atlas UI:


Either select or hover over the database to drop and click on the plus sign + icon.


For more information on MongoDB collection names, see Naming Restrictions.


Select whether the collection is a capped collection. If you select to create a capped collection, specify the maximum size in bytes.


Select whether the collection is a time series collection. If you select to create a time series collection, specify the time field and granularity. You can optionally specify the meta field and the time for old data in the collection to expire.


Upon successful creation, the collection appears underneath the database in the Atlas UI.

From the Collections tab, you can view the databases and collections in the deployment. Atlas shows the databases in the left pane of the Atlas UI:

Screenshot highlighting databases.

To view the collections in a particular database, click on the name of the database.


Atlas bases the document count that appears on the Collections tab on cached metadata using collStats. This count might differ from the actual document count in the collection. For example, an unexpected shutdown can throw off the count. Use the db.collection.countDocuments() method for the most accurate document count.

To drop a collection, including its documents and indexes, through the Atlas UI:


Either select or hover of the collection to drop and click on its trash can icon.


Confirm by typing the name of the collection, and click Drop.

If you have large data sets and perform high throughput operations, you can shard a collection to distribute data across the shards.


Before you start, you must have the following:

To shard a collection through the Atlas UI:


See Connect via mongosh.


To enable sharding, run the following command:



To enable sharding for the sample_analytics dataset:


To learn more, see Enable Sharding for a Database in the MongoDB manual.


To create an index on the shard key, run the following command:



To create an index on the shard key for the sample_analytics.customers collection:

db.sample_analytics.runCommand( { createIndexes: "customers", indexes: [ { key: { "username": 1 }, "name": "usernameIndex" }], "commitQuorum": "majority" } )

To learn more, see:


To shard a collection, run the following command:

sh.shardCollection(“<database>.<collection>”, { "<indexed-field>" : 1 } )


To shard the sample_analytics.customers collection:


To learn more, see Shard a Collection in the MongoDB manual.

←  Create, View, and Drop DatabasesCreate, View, Update, and Delete Documents →
Share Feedback
© 2023 MongoDB, Inc.


  • Careers
  • Investor Relations
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2023 MongoDB, Inc.