Navigation

Alpha Release of MongoDB CLI

This is a pre-release early version of MongoDB CLI. Do not use MongoDB CLI to manage production environments.

mongocli atlas alerts configs fields type

On this page

The alerts configs fields type command retrieves all field names that the matchers.fieldName option accepts when you create or update an alert configuration.

Syntax

mongocli atlas alert|alerts config|configs fields type|types
     [ --profile|-P <profile-name> ]

Options

Option Type Description Required?
--profile, -P string Name of the profile where the public and private keys for the project are saved. If omitted, uses the default profile. To learn more about creating a profile, see Configure the MongoDB CLI. no

Output

The command prints the following array to the terminal if the command succeeds. If the command returns an error, see Troubleshooting for recommended solutions.

[
  "TYPE_NAME",
  "HOSTNAME",
  "PORT",
  "HOSTNAME_AND_PORT",
  "REPLICA_SET_NAME",
  "SHARD_NAME",
  "CLUSTER_NAME"
]

When you create or update an alert configuration:

  • Host alerts support these fields:
    • TYPE_NAME
    • HOSTNAME
    • PORT
    • HOSTNAME_AND_PORT
    • REPLICA_SET_NAME
  • Replica set alerts support these fields:
    • REPLICA_SET_NAME
    • SHARD_NAME
    • CLUSTER_NAME
  • Sharded cluster alerts support these fields:
    • CLUSTER_NAME
    • SHARD_NAME

Example

The following example uses the mongocli atlas alerts configs fields type command to retrieve all field names that the matchers.fieldName option accepts when you create or update an alert configuration. It uses the profile named myprofile for accessing Atlas.

mongocli atlas alerts configs fields type --profile myprofile

The previous command prints the following fields in JSON format to the terminal. To learn more about these fields, see Output.

[
  "TYPE_NAME",
  "HOSTNAME",
  "PORT",
  "HOSTNAME_AND_PORT",
  "REPLICA_SET_NAME",
  "SHARD_NAME",
  "CLUSTER_NAME"
]