You are currently browsing legacy 5.0 version of documentation. Click here to switch to the newest 5.1 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Counter Revisions

When the revisions feature is enabled, a snapshot of a document that holds Counters will include in its metadata a @counters-snapshot property, that holds all the document's counter names and values (at the time of the revision creation).
This can be useful when historic records of the documents and their counter values are needed.

How do counter operations affect revision creation

Creation of a new counter and deletion of a counter modify the parent document (documents hold their counter names in the metadata) and will trigger a revision creation.
Incrementing an existing counter does not modify the parent document and will not trigger a revision creation.


List<MetadataAsDictionary> orderRevisionsMetadata =
            id: "orders/1-A",
            start: 0,
            pageSize: 10);

List<MetadataAsDictionary> orderCountersSnapshots = 
        .Where(metadata => 
        .Select(metadata =>