Docs Menu

Edit an Archiving Rule

On this page

  • Edit an Archiving Rule Through the UI
  • Edit the Partition on the Cloud Object Store
  • Edit an Archiving Rule Through the API
Important
Serverless Instances are in Preview

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.

To edit an online archive, in your Atlas UI:

1
  1. If it is not already displayed, select the organization that contains your desired project from the Organizations menu in the navigation bar.
  2. If it is not already displayed, select your desired project from the Projects menu in the navigation bar.
  3. If the Database Deployments page is not already displayed, click Databases in the sidebar.
2
  1. Click the name of the cluster.
  2. Click the Online Archive tab to view the list of online archives, if any, for the cluster.
3

You can:

  • Pause Archive (only if state is Active)
  • Edit Archiving Rule
  • Delete Archive
  • Resume Archive (only if state is Paused)
4
  • 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:

    1. Select Edit Age Limit.
    2. Modify the number of days Atlas must store data on the active Atlas cluster in the Enter a new age limit field.
    3. Click Save for the changes to take effect.
  • If you are modifying a custom query for selecting documents to archive:

    1. Select Edit Custom Query.
    2. Enter a valid JSON filter to select documents for archiving.

      Note

      Atlas 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.

    3. Click Save for the changes to take effect.

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.

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.

Give Feedback
MongoDB logo
© 2021 MongoDB, Inc.

About

  • Careers
  • Legal Notices
  • Privacy Notices
  • Security Information
  • Trust Center
© 2021 MongoDB, Inc.