MongoDB CLI

The MongoDB Command Line Interface (mongocli) allows you to create and manage MongoDB Cloud deployments with MongoDB Atlas. You can also use the MongoDB CLI to manage your on-premises MongoDB environments with MongoDB Cloud Manager and MongoDB Ops Manager. With the MongoDB CLI, you can quickly interact with MongoDB services from the command line for easier testing and scripting.


You can install the MongoDB CLI via homebrew, binary download or clone the repo. Help us improve the MongoDB Command Line Interface by posting your ideas and suggestions for improvements.



To report bugs, please use our mongodbcli github issues.


  1. Add commands to stop/start/restart a mongodb process in a cluster

    Currently, we see that mongocli supports stop/start the "entire" cluster which is not suitable for general maintenance scenario which requires cluster availability.

    Commands to stop/start/restart a mongodb process in a cluster will be useful for the scenario of the server maintenance that requires MongoDB Administrator to stop a single node prior to the maintenance time and start it afterward.

    3 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  mongodbcli with Ops Manager  ·  Flag idea as inappropriate…  ·  Admin →
  2. Support setting userToDNMapping in LDAP config

    There are flags to save other LDAP configuration settings but none for this portion. I would imagine it to be three flags with two being mutually exclusive (per docs at https://docs.mongodb.com/manual/reference/configuration-options/#security.ldap.userToDNMapping):
    [ --mappingMatch <regex> { --mappingLdapQuery <query> | --mappingSubstitution <DN> } ]

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  mongodbcli with Atlas  ·  Flag idea as inappropriate…  ·  Admin →
  3. Add command to restart the cluster

    Refer to the Ops Manager Commands => https://docs.mongodb.com/mongocli/stable/reference/ops-manager/cluster-commands/, there are the commands to startup/shutdown cluster but not restart.
    It will be helpful to have a restart command that will rolling restart a cluster.

    1 vote

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  mongodbcli with Ops Manager  ·  Flag idea as inappropriate…  ·  Admin →
  4. option for activate/deactivate monitoring/backup agents

    Currently, there is no command for simple activation and deactivation of monitoring/backup agents.

    2 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  mongodbcli with Ops Manager  ·  Flag idea as inappropriate…  ·  Admin →
  5. Allow to perform rolling compact via restapi

    Allow to perform rolling compact via CM/OM restAPI (processes.lastCompact parameter)

    3 votes

    We're glad you're here

    Please sign in to leave feedback

    Signed in as (Sign out)

    We’ll send you updates on this idea

    1 comment  ·  mongodbcli with Ops Manager  ·  Flag idea as inappropriate…  ·  Admin →
  • Don't see your idea?

Feedback and Knowledge Base