The ConfigureRevisionsOperation modifies the revisions settings for a particular database.
Within that database, each collection can have its own separate revisions
To configure the revisions settings for a database and/or the collections in that database, follow these steps:
1. Create a
RevisionsCollectionConfiguration object for each desired collection.
2. Put those
RevisionsCollectionConfiguration objects in a
3. Send that
RevisionsConfiguration to the server.
This object contains the four revisions settings for a particular collection:
public class RevisionsCollectionConfiguration
public TimeSpan? MinimumRevisionAgeToKeep;
public long? MinimumRevisionsToKeep;
public bool Disabled;
public bool PurgeOnDelete;
||The minimum number of revisions to keep per document
null - unlimited
||The minimum amount of time to keep each revision. Format of
null - unlimited
||Indicates whether to completely disable revisions for documents in this collection
||When a document is deleted, this indicates whether all of its revisions should be deleted as well
A revision is only deleted if both the
MinimumRevisionsToKeep for that document is exceeded, and the revision is older
MinimumRevisionAgeToKeep limit. The oldest revisions are deleted first.
By default both these options are set to
null, meaning that an unlimited number of revisions will be saved
MinimumRevisionsToKeep is null, revisions will be deleted only when they are older than
MinimumRevisionAgeToKeep is null, revisions will be deleted each time there are more revisions than
These deletions will only take place when a new revision is added to a document. Until a new revision is added, that
document's revisions can exceed these limits.
This object contains a
Dictionary of the revision settings for each collection in the database, plus an optional default
public class RevisionsConfiguration
public Dictionary<string, RevisionsCollectionConfiguration> Collections;
public RevisionsCollectionConfiguration Default;
||A dictionary in which the keys are collection names, and the values are the corresponding configurations
||An optional default configuration that applies to any collection not listed in
Note that when this object is sent to the server, it overrides the configurations for all collections, including all existing
configurations currently on the server. If a collection is not listed in
Default has not been set, the
default values listed in the table above
Lastly, the operation itself sends the
RevisionsConfiguration to the server, overriding all existing collection configurations.
You'll want to store these configurations on the client side so they don't have to be created from scratch each time you want to
public ConfigureRevisionsOperation(RevisionsConfiguration configuration);
||The new revision settings for a particular database