mongocli atlas cluster onlinearchive update
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 update
command modifies the archiving rule in the
specified online archive for
the specified cluster. You can also modify the archiving rule through the
Atlas UI or API.
Syntax
mongocli atlas cluster onlinearchive update <online-archive-id> --archiveAfter <number-of-days> --clusterName <cluster-name> [ --output|-o <output-format> ] [ --profile|-P <profile-name> ] [ --projectId <project-ID> ]
Options
Option | Type | Description | Required? |
---|---|---|---|
<online-archive-id> | string | Unique identifier of the online archive to update. | yes |
--archiveAfter | int | Number of days after which to archive cluster data. | yes |
--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:
|
Examples
The following example uses the mongocli atlas cluster onlinearchive update
command to modify the archiving rule in the specified online archive for the
cluster named myTestCluster
. It uses the default profile to access the
project.
mongocli atlas cluster onlinearchive update 5f189832e26ec075e10c32d3 --clusterName myTestCluster --archiveAfter 5 --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": 5 }, "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": true, "state": "PAUSED" }