Edit an Archiving Rule¶
On this page
Serverless instances are in preview and do not support this feature at this time. To learn more, see Serverless Instance Limitations.
You can modify the number of days to keep data on the Atlas cluster (the Age Limit) or the custom JSON query used to select documents for archiving from the Atlas UI and API. You can't change the archiving criteria from Date Match to Custom Filter, or vice versa.
Edit an Archiving Rule Through the UI¶
To edit an online archive, in your Atlas UI:
Navigate to the Database Deployments page for your project.¶
- If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
- If it is not already displayed, select your desired project from the Projects menu in the navigation bar.
- If the Database Deployments page is not already displayed, click Databases in the sidebar.
Navigate to the Online Archive tab for your cluster.¶
- Click the name of the cluster.
- Click the Online Archive tab to view the list of online archives, if any, for the cluster.
Click the ellipsis (...
) in the Actions column for the online archive to display the list of allowed actions.¶
You can:
- Pause Archive (only if state is Active)
- Edit Archiving Rule
- Delete Archive
- Resume Archive (only if state is Paused)
Click and make changes to your archiving rule.¶
If you are modifying a criteria based on a combination of a date and number of days to store the data on the Atlas cluster:
- Select Edit Age Limit.
- Modify the number of days Atlas must store data on the active Atlas cluster in the Enter a new age limit field.
- Click Save for the changes to take effect.
If you are modifying a custom query for selecting documents to archive:
- Select Edit Custom Query.
Enter a valid JSON filter to select documents for archiving.
NoteAtlas uses the specified query with the db.collection.find(query) command. Custom queries do not support JavaScript expressions. Also, you cannot pass an empty document
{}
to return all documents.- Click Save for the changes to take effect.
Edit the Partition on the Cloud Object Store¶
You cannot modify the partition fields or structure from the Atlas
UI or API. However, you can manually migrate the data from the cloud
object storage using mongodump
, delete
the online archive, use mongorestore
to restore the data on the
Atlas cluster, and then create a new online archive for the
collection with the desired partition fields and/or structure.
Edit an Archiving Rule Through the API¶
To edit an online archive through the API, send a PATCH
request
to the onlineArchives endpoint with the
unique ID of the online archive to update. To learn more about the
API syntax and options, see Update an Online Archive.