mongocli atlas cluster onlinearchive list
Note
Beta
Online archive is available as a Beta feature. The feature and the corresponding documentation may change at any time during the Beta stage.
The onlinearchive list
command retrieves all the online archives for the specified cluster. You can
also view the online archives for a cluster through the
Atlas UI or API.
Syntax
mongocli atlas cluster onlinearchive list|ls --clusterName <cluster-name> [ --output|-o <output-format> ] [ --profile|-P <profile-name> ] [ --projectId <project-ID> ]
Options
Option | Type | Description | Required? |
---|---|---|---|
--clusterName | string | Name of the cluster. | yes |
--output , -o | string | Command output format. Valid values are:
If omitted, the command returns output in the default format. | no |
--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 |
--projectId | string | Unique identifier of the project. If omitted, uses the project ID in the profile or environment variable. | no |
Output
The command prints the following fields in the specified format to the terminal if the command succeeds. If the command prints an error, see Troubleshooting for recommended solutions.
Field | Type | Description |
---|---|---|
clusterName | string | Name of the cluster that contains the collection. |
collName | string | Name of the collection. |
criteria | document | Criteria to use for archiving data. |
criteria.dateField | string | Name of the date field that the online archive is based on. Data is
archived when the current date is greater than the value of the date
field plus the number of days specified via the archiveAfter option. |
criteria.expireAfterDays | int | Number of days after which to archive data as specified using the
archiveAfter option. Data is archived when the current date is
greater than the value of the date field specified via the dateField
option plus the number of days specified here. |
dbName | string | Name of the database that contains the collection. |
groupId | string | Unique identifier of the project that contains the cluster. |
partitionFields | array of documents | Fields to use to partition data. |
partitionFields.fieldName | string | Name of the field. |
partitionFields.fieldType | string | Data type of the field. |
partitionFields.order | int | Position of the field in the partition. Value can be:
|
paused | boolean | Whether or not the online archive is paused. Value is:
|
state | string | State of the online archive. Value can be:
|
Example
The following example uses the mongocli atlas cluster onlinearchive list
command to retrieve the online archives configured for the cluster named
myTestCluster
. The command uses the default profile to access the
project.
mongocli atlas cluster onlinearchive list --clusterName myTestCluster --output json
The previous command prints the following fields in the specified format to the terminal. To learn more about these fields, see Output.
[ { "_id": "5f189832e26ec075e10c32d3", "clusterName": "myTestCluster", "collName": "movies", "criteria": { "dateField": "released", "expireAfterDays": 2 }, "dbName": "sample_mflix", "groupId": "5e2211c17a3e5a48f5497de3", "partitionFields": [ { "fieldName": "title", "fieldType": "string", "order": 0 }, { "fieldName": "year", "fieldType": "int", "order": 1 }, { "fieldName": "released", "fieldType": "date", "order": 2 } ], "paused": false, "state": "ACTIVE" } ]