From bfc5a0ba16f3fe2ed3ea42507d6733444760cbc3 Mon Sep 17 00:00:00 2001 From: reebhub Date: Thu, 27 Feb 2025 16:38:16 +0200 Subject: [PATCH] add PHP document extensions pages (revisions & counters) --- .../counters-and-other-features.php.markdown | 194 +++++++++++ ...ounters-and-other-features.python.markdown | 1 - .../counters/create-or-modify.php.markdown | 71 ++++ .../counters/delete.php.markdown | 64 ++++ .../counters/delete.python.markdown | 2 +- .../counters/indexing.php.markdown | 74 ++++ .../counters/overview.php.markdown | 219 ++++++++++++ .../retrieve-counter-values.php.markdown | 107 ++++++ .../retrieve-counter-values.python.markdown | 28 +- .../configure-revisions.php.markdown | 99 ++++++ ...ct-revisions-configuration.dotnet.markdown | 86 +++++ ...nflict-revisions-configuration.js.markdown | 83 +++++ ...flict-revisions-configuration.php.markdown | 83 +++++ .../operations/get-revisions.php.markdown | 65 ++++ .../client-api/overview.php.markdown | 66 ++++ .../client-api/session/counting.php.markdown | 55 +++ .../session/including.dotnet.markdown | 204 +++++++++++ .../client-api/session/including.js.markdown | 196 +++++++++++ .../client-api/session/including.php.markdown | 178 ++++++++++ .../client-api/session/loading.php.markdown | 110 ++++++ .../revisions-and-other-features.php.markdown | 248 ++++++++++++++ ...visions-and-other-features.python.markdown | 2 +- .../DocumentExtensions/Counters/Counters.php | 316 ++++++++++++++++++ .../Counters/IndexingCounters.php | 169 ++++++++++ .../Operations/ConfigureRevisions.php | 182 ++++++++++ .../ConfigureRevisionsForConflicts.php | 61 ++++ .../ClientAPI/Operations/GetRevisions.php | 77 +++++ .../Revisions/ClientAPI/Session/Counting.php | 33 ++ .../Revisions/ClientAPI/Session/Including.php | 254 ++++++++++++++ .../Revisions/ClientAPI/Session/Loading.php | 131 ++++++++ .../Session/RevisionsAndOtherFeatures.php | 38 +++ .../counters-and-other-features.php.markdown | 194 +++++++++++ ...ounters-and-other-features.python.markdown | 1 - .../configure-revisions.php.markdown | 99 ++++++ ...flict-revisions-configuration.php.markdown | 83 +++++ .../operations/get-revisions.php.markdown | 65 ++++ .../operations/get-revisions.python.markdown | 2 +- .../client-api/overview.php.markdown | 66 ++++ .../client-api/session/counting.php.markdown | 55 +++ .../client-api/session/including.php.markdown | 178 ++++++++++ .../client-api/session/loading.php.markdown | 110 ++++++ .../revisions-and-other-features.php.markdown | 248 ++++++++++++++ ...visions-and-other-features.python.markdown | 2 +- .../DocumentExtensions/Counters/Counters.php | 316 ++++++++++++++++++ .../Counters/IndexingCounters.php | 169 ++++++++++ .../Operations/ConfigureRevisions.php | 182 ++++++++++ .../ConfigureRevisionsForConflicts.php | 61 ++++ .../ClientAPI/Operations/GetRevisions.php | 77 +++++ .../Revisions/ClientAPI/Session/Counting.php | 33 ++ .../Revisions/ClientAPI/Session/Including.php | 254 ++++++++++++++ .../Revisions/ClientAPI/Session/Loading.php | 131 ++++++++ .../Session/RevisionsAndOtherFeatures.php | 38 +++ .../configure-revisions.php.markdown | 99 ++++++ .../Operations/ConfigureRevisions.php | 182 ++++++++++ 54 files changed, 6121 insertions(+), 20 deletions(-) create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/counters-and-other-features.php.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/create-or-modify.php.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/delete.php.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/indexing.php.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/overview.php.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/retrieve-counter-values.php.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/configure-revisions.php.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/conflict-revisions-configuration.dotnet.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/conflict-revisions-configuration.js.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/conflict-revisions-configuration.php.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/get-revisions.php.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/revisions/client-api/overview.php.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/revisions/client-api/session/counting.php.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/revisions/client-api/session/including.dotnet.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/revisions/client-api/session/including.js.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/revisions/client-api/session/including.php.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/revisions/client-api/session/loading.php.markdown create mode 100644 Documentation/5.4/Raven.Documentation.Pages/document-extensions/revisions/revisions-and-other-features.php.markdown create mode 100644 Documentation/5.4/Samples/php/DocumentExtensions/Counters/Counters.php create mode 100644 Documentation/5.4/Samples/php/DocumentExtensions/Counters/IndexingCounters.php create mode 100644 Documentation/5.4/Samples/php/DocumentExtensions/Revisions/ClientAPI/Operations/ConfigureRevisions.php create mode 100644 Documentation/5.4/Samples/php/DocumentExtensions/Revisions/ClientAPI/Operations/ConfigureRevisionsForConflicts.php create mode 100644 Documentation/5.4/Samples/php/DocumentExtensions/Revisions/ClientAPI/Operations/GetRevisions.php create mode 100644 Documentation/5.4/Samples/php/DocumentExtensions/Revisions/ClientAPI/Session/Counting.php create mode 100644 Documentation/5.4/Samples/php/DocumentExtensions/Revisions/ClientAPI/Session/Including.php create mode 100644 Documentation/5.4/Samples/php/DocumentExtensions/Revisions/ClientAPI/Session/Loading.php create mode 100644 Documentation/5.4/Samples/php/DocumentExtensions/Revisions/ClientAPI/Session/RevisionsAndOtherFeatures.php create mode 100644 Documentation/6.0/Raven.Documentation.Pages/document-extensions/counters/counters-and-other-features.php.markdown create mode 100644 Documentation/6.0/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/configure-revisions.php.markdown create mode 100644 Documentation/6.0/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/conflict-revisions-configuration.php.markdown create mode 100644 Documentation/6.0/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/get-revisions.php.markdown create mode 100644 Documentation/6.0/Raven.Documentation.Pages/document-extensions/revisions/client-api/overview.php.markdown create mode 100644 Documentation/6.0/Raven.Documentation.Pages/document-extensions/revisions/client-api/session/counting.php.markdown create mode 100644 Documentation/6.0/Raven.Documentation.Pages/document-extensions/revisions/client-api/session/including.php.markdown create mode 100644 Documentation/6.0/Raven.Documentation.Pages/document-extensions/revisions/client-api/session/loading.php.markdown create mode 100644 Documentation/6.0/Raven.Documentation.Pages/document-extensions/revisions/revisions-and-other-features.php.markdown create mode 100644 Documentation/6.0/Samples/php/DocumentExtensions/Counters/Counters.php create mode 100644 Documentation/6.0/Samples/php/DocumentExtensions/Counters/IndexingCounters.php create mode 100644 Documentation/6.0/Samples/php/DocumentExtensions/Revisions/ClientAPI/Operations/ConfigureRevisions.php create mode 100644 Documentation/6.0/Samples/php/DocumentExtensions/Revisions/ClientAPI/Operations/ConfigureRevisionsForConflicts.php create mode 100644 Documentation/6.0/Samples/php/DocumentExtensions/Revisions/ClientAPI/Operations/GetRevisions.php create mode 100644 Documentation/6.0/Samples/php/DocumentExtensions/Revisions/ClientAPI/Session/Counting.php create mode 100644 Documentation/6.0/Samples/php/DocumentExtensions/Revisions/ClientAPI/Session/Including.php create mode 100644 Documentation/6.0/Samples/php/DocumentExtensions/Revisions/ClientAPI/Session/Loading.php create mode 100644 Documentation/6.0/Samples/php/DocumentExtensions/Revisions/ClientAPI/Session/RevisionsAndOtherFeatures.php create mode 100644 Documentation/7.0/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/configure-revisions.php.markdown create mode 100644 Documentation/7.0/Samples/php/DocumentExtensions/Revisions/ClientAPI/Operations/ConfigureRevisions.php diff --git a/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/counters-and-other-features.php.markdown b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/counters-and-other-features.php.markdown new file mode 100644 index 0000000000..0965fa6c6f --- /dev/null +++ b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/counters-and-other-features.php.markdown @@ -0,0 +1,194 @@ +# Counters and Other Features +--- + +{NOTE: } + +* This section describes the relationships between Counters and other RavenDB features: + * How Counters are supported by the different features. + * How Counters trigger features' execution. + +* In this page: + * [Counters and Indexing](../../document-extensions/counters/counters-and-other-features#counters-and-indexing) + * [Counters and Queries](../../document-extensions/counters/counters-and-other-features#counters-and-queries) + * [Counters and Revisions](../../document-extensions/counters/counters-and-other-features#counters-and-revisions) + * [Counters and Changes API](../../document-extensions/counters/counters-and-other-features#counters-and-changes-api) + * [Counters and Ongoing Tasks](../../document-extensions/counters/counters-and-other-features#counters-and-ongoing-tasks) - `Backup`, `External replication`, `ETL` + * [Counters and Other Features: summary](../../document-extensions/counters/counters-and-other-features#counters-and-other-features-summary) + * [Including Counters](../../document-extensions/counters/counters-and-other-features#including-counters) +{NOTE/} + +--- + +{PANEL: } + +### Counters and Indexing + +Indexing Counters can speed-up finding them and the documents that contain them. + +* **Indexing Counter Values** + Dynamic indexes (aka auto-indexes) _cannot_ index counter values. To index counter values, + create a static index that inherits from `AbstractCountersIndexCreationTask` ([see here](../../document-extensions/counters/indexing)). + +* **Indexing Counter Names** + Re-indexing due to Counter-name modification is normally rare enough to pause no performance issues. + To index a document's Counters by name, use [CounterNamesFor](../../document-extensions/counters/indexing#section-1). + +--- + +###Counters and Queries + +Send the server **raw queries** for execution. + +* You can query Counters **by name** but **not by value**. + This is because queries are generally [based on indexes](../../start/getting-started#example-iii---querying), and Counter values are [not indexed](../../document-extensions/counters/counters-and-other-features#counters-and-indexing). +* Counter values **can** be [projected](../../indexes/querying/projections) from query results, as demonstrated in the following examples. + This way a client can get counter values from a query without downloading whole documents. + +* Use [RawQuery](../../client-api/session/querying/how-to-query#session.advanced.rawquery) to send the server raw RQL expressions for execution. + * You can use the `counter` method. + **Returned Counter Value**: **Accumulated** + + * You can use the `counterRaw` method. + **Returned Counter Value**: **Distributed** + A Counter's value is returned as a series of values, each maintained by one of the nodes. + * It is not expected of you to use this in your application. + Applications normally use the Counter's overall value, and very rarely refer to the value each node gives it. + + + `counter` and `counterRaw` samples: + {CODE-TABS} + {CODE-TAB:php:counter counters_region_rawqueries_counter@DocumentExtensions\Counters\Counters.php /} + {CODE-TAB:php:counterRaw counters_region_rawqueries_counterRaw@DocumentExtensions\Counters\Counters.php /} + {CODE-TABS/} + +--- + +###Counters and Revisions + +A document revision stores all the document Counters' names and values when the revision was created. + +* **Stored Counter Values**: **Accumulated** + A revision stores a Counter's value as a single sum, with no specification of the Counter's value on each node. + +* Revisions-creation can be initiated by **Counter-name modification**. + * When the Revisions feature is enabled, the creation or deletion of a Counter initiates the creation of a new document revision. + * Counter **value** modifications do **not** cause the creation of new revisions. + +--- + +###Counters and Changes API + +[Changes API](../../client-api/changes/what-is-changes-api#changes-api) is a Push service, that can inform you of various changes on the Server, including [changes in Counter values](../../client-api/changes/how-to-subscribe-to-counter-changes#changes-api--how-to-subscribe-to-counter-changes). +You can target all Counters, or specify the ones you wish to follow. + +* **Pushed Counter Value**: **Accumulated** + `Changes API` methods return a Counter's value as a single sum, without specifying its value on each node. +* The service is initiated by **Counter Value Modification**. + +--- + +###Counters and Ongoing Tasks: + +Each [ongoing task](../../studio/database/tasks/ongoing-tasks/general-info) relates to Counters in its own way. + +* **Counters** and the **Backup task** + There are two [backup](../../studio/database/tasks/backup-task) types: **logical-backup** and **snapshot**. + Both types store and restore **all** data, including Counters. + Both types operate as an ongoing backup routine, with a pre-set time schedule. + * Logical Backup: + **Backed-up Counter values**: **Distributed** + A logical backup is a higher-level implementation of Smuggler. + As with Smuggler, Counters are backed-up and restored including their values on all nodes. + * Snapshot: + A snapshot stores all data and settings as a single binary image. + All components, including Counters, are restored to the exact same state they've been at during backup. + +* **Counters** and the **External Replication task** + The ongoing [external replication](../../studio/database/tasks/ongoing-tasks/external-replication-task) task replicates all data, including Counters. + * **Replicated Counter Value**: **Distributed** + Counters are replicated along with their values on all nodes. + * Replication can be initiated by both **Counter-name update** _and_ **Counter-value modification**. + +* **Counters** and the **ETL task** + [ETL](../../server/ongoing-tasks/etl/basics) is used to export data from RavenDB to an external (either Raven or SQL) database. + * [SQL ETL](../../server/ongoing-tasks/etl/sql) is **not supported**. + Counters cannot be exported to an SQL database over SQL ETL. + * [RavenDB ETL](../../server/ongoing-tasks/etl/raven) **is supported**. + Counters [are](../../server/ongoing-tasks/etl/raven#counters) exported over RavenDB ETL. + * Export can be initiated by both **Counter-name update** _and_ **Counter-value modification**. + * **Exported Counter Value**: **Distributed** + Counters are exported along with their values on all nodes. + * Counters can be [exported using a script](../../server/ongoing-tasks/etl/raven#adding-counter-explicitly-in-a-script). + **Default behavior**: When an ETL script is not provided, Counters are exported. + +{NOTE: } +###Counters and Other Features: Summary + +Use this table to find if and how various RavenDB features are triggered by Counters, +and how the various features handle Counter values. + +* In the **Triggered By** column: + * _Document Change_ - Feature is triggered by a Counter Name update. + * _Countrer Value Modification_ - Feature is triggered by a Counter Value modification. + * _Time Schedule_ - Feature is invoked by a pre-set time routine. + * _No Trigger_ - Feature is executed manually, through the Studio or by a Client. +* In the **Counter Value** column: + * _Accumulated_ - Counter Value is handled as a single accumulated sum. + * _Distributed_ - Counter Value is handled as a series of values maintained by cluster nodes. + +| **Feature** | **Triggered by** | **Counter Value** | +|-------------|:-------------|:-------------| +| [Indexing](../../document-extensions/counters/counters-and-other-features#counters-and-indexing) | _Document Change_ | doesn't handle values | +| [LINQ Queries](../../document-extensions/counters/counters-and-other-features#counters-and-queries) | _No trigger_ | _Accumulated_ | +| [Raw Queries](../../document-extensions/counters/counters-and-other-features#counters-and-queries) | _No trigger_ | `counter()` - _Accumulated_
`counterRaw()` - _Distributed_ | +| [Backup Task](../../document-extensions/counters/counters-and-other-features#counters-and-ongoing-tasks) | _Time Schedule_ | _Distributed_ | +| [RavenDB ETL Task](../../document-extensions/counters/counters-and-other-features#counters-and-ongoing-tasks) | _Document Change_,
_Countrer Value Modification_ | _Distributed_ | +| [External Replication task](../../document-extensions/counters/counters-and-other-features#counters-and-ongoing-tasks) | _Document Change_,
_Countrer Value Modification_ | _Distributed_ | +| [Changes API](../../document-extensions/counters/counters-and-other-features#counters-and-changes-api) | _Countrer Value Modification_ | _Accumulated_ | +| [Revision creation](../../document-extensions/counters/counters-and-other-features#counters-and-revisions) | _Document Change_ | _Accumulated_ | + +{NOTE/} + +--- + +###Including Counters +You can [include](../../client-api/how-to/handle-document-relationships#includes) Counters while loading a document. +An included Counter is retrieved in the same request as its owner-document and is held by the session, +so it can be immediately retrieved when needed with no additional remote calls. + + +* **Including Counters when using [session.load](../../client-api/session/loading-entities#session--loading-entities)**: + * Include a single Counter using `include_counter` + * Include multiple Counters using `include_counters` + + `include_counter` and `include_counters` usage samples: + {CODE-TABS} + {CODE-TAB:php:IncludeCounter counters_region_load_include1@DocumentExtensions\Counters\Counters.php /} + {CODE-TAB:php:IncludeCounters counters_region_load_include2@DocumentExtensions\Counters\Counters.php /} + {CODE-TABS/} + +* **Including Counters when using [Session.Query](../../client-api/session/querying/how-to-query#session--querying--how-to-query)**: + * Include a single Counter using `include_counter`. + * Include multiple Counters using `include_counters`. + + `include_counter` and `include_counters` usage samples: + {CODE-TABS} + {CODE-TAB:php:IncludeCounter counters_region_query_include_single_Counter@DocumentExtensions\Counters\Counters.php /} + {CODE-TAB:php:IncludeCounters counters_region_query_include_multiple_Counters@DocumentExtensions\Counters\Counters.php /} + {CODE-TABS/} + +{PANEL/} + +## Related articles +**Studio Articles**: +[Studio Counters Management](../../studio/database/document-extensions/counters#counters) + +**Client-API - Session Articles**: +[Counters Overview](../../document-extensions/counters/overview) +[Creating and Modifying Counters](../../document-extensions/counters/create-or-modify) +[Deleting a Counter](../../document-extensions/counters/delete) +[Retrieving Counter Values](../../document-extensions/counters/retrieve-counter-values) +[Counters In Clusters](../../document-extensions/counters/counters-in-clusters) + +**Client-API - Operations Articles**: +[Counters Operations](../../client-api/operations/counters/get-counters#operations--counters--how-to-get-counters) diff --git a/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/counters-and-other-features.python.markdown b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/counters-and-other-features.python.markdown index 415502c0f5..92ea03b48b 100644 --- a/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/counters-and-other-features.python.markdown +++ b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/counters-and-other-features.python.markdown @@ -11,7 +11,6 @@ * [Counters and Indexing](../../document-extensions/counters/counters-and-other-features#counters-and-indexing) * [Counters and Queries](../../document-extensions/counters/counters-and-other-features#counters-and-queries) * [Counters and Revisions](../../document-extensions/counters/counters-and-other-features#counters-and-revisions) - * [Counters and Smuggler](../../document-extensions/counters/counters-and-other-features#counters-and-smuggler) * [Counters and Changes API](../../document-extensions/counters/counters-and-other-features#counters-and-changes-api) * [Counters and Ongoing Tasks](../../document-extensions/counters/counters-and-other-features#counters-and-ongoing-tasks) - `Backup`, `External replication`, `ETL`, `Data Subscription` * [Counters and Other Features: summary](../../document-extensions/counters/counters-and-other-features#counters-and-other-features-summary) diff --git a/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/create-or-modify.php.markdown b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/create-or-modify.php.markdown new file mode 100644 index 0000000000..bca45c35f4 --- /dev/null +++ b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/create-or-modify.php.markdown @@ -0,0 +1,71 @@ +# Create or Modify Counters +--- + +{NOTE: } + +* Use the `countersFor.increment` method to **create** a new Counter or **modify** an existing Counter's value. + +* If the Counter exists, `increment` will add the specified number to the Counter's current value. + If the Counter doesn't exist, `increment` will create it and set its initial value. + +* For all other `countersFor` methods see this [Overview](../../document-extensions/counters/overview#counter-methods-and-the--object). + +* In this page: + - [`increment` usage](../../document-extensions/counters/create-or-modify#increment-usage) + - [Example](../../document-extensions/counters/create-or-modify#example) + - [Syntax](../../document-extensions/counters/create-or-modify#syntax) + +{NOTE/} + +--- + +{PANEL: `increment` usage} + + **Flow**: + +* Open a session. +* Create an instance of `countersFor`. + * Either pass `countersFor` an explicit document ID, -or- + * Pass it an [entity tracked by the session](../../client-api/session/loading-entities), + e.g. a document object returned from [session.Query](../../client-api/session/querying/how-to-query) or from [session.Load](../../client-api/session/loading-entities#load). +* Call `countersFor.increment`. +* Call `session.saveChanges` for the changes to take effect. + +**Note**: + +* Modifying a Counter using `increment` only takes effect when `session.aaveChanges()` is executed. +* To **decrease** a Counter's value, pass the method a negative number to the `increment` method. + +{PANEL/} + +{PANEL: Example} + +{CODE:php counters_region_Increment@DocumentExtensions\Counters\Counters.php /} + +{PANEL/} + +{PANEL: Syntax} + +{CODE:php Increment-definition@DocumentExtensions\Counters\Counters.php /} + +| Parameter | Type | Description | +|------------------|-------|-----------------| +| **counter** | `string` | Counter name | +| **delta** | `int` | Increase Counter by this value.
Default value is 1.
For a new Counter, this number will be its initial value. | + +{PANEL/} + +## Related articles + +**Studio Articles**: +[Studio Counters Management](../../studio/database/document-extensions/counters#counters) + +**Client-API - Session Articles**: +[Counters Overview](../../document-extensions/counters/overview) +[Deleting a Counter](../../document-extensions/counters/delete) +[Retrieving Counter Values](../../document-extensions/counters/retrieve-counter-values) +[Counters and other features](../../document-extensions/counters/counters-and-other-features) +[Counters In Clusters](../../document-extensions/counters/counters-in-clusters) + +**Client-API - Operations Articles**: +[Counters Operations](../../client-api/operations/counters/get-counters#operations--counters--how-to-get-counters) diff --git a/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/delete.php.markdown b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/delete.php.markdown new file mode 100644 index 0000000000..840715ea96 --- /dev/null +++ b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/delete.php.markdown @@ -0,0 +1,64 @@ +# Delete Counter +--- + +{NOTE: } + +* Use the `countersFor.delete` method to remove a specific Counter from a document. + +* All the document's Counters are deleted when the document itself is deleted. + +* For all other `countersFor` methods see this [Overview](../../document-extensions/counters/overview#counter-methods-and-the--object). + +* In this page: + * [`delete` usage](../../document-extensions/counters/delete#delete-usage) + * [Example](../../document-extensions/counters/delete#example) + * [Syntax](../../document-extensions/counters/delete#syntax) + +{NOTE/} + +--- + +{PANEL: `delete` usage} + +**Flow**: + +* Open a session. +* Create an instance of `countersFor`. + * Either pass `countersFor` an explicit document ID, -or- + * Pass it an [entity tracked by the session](../../client-api/session/loading-entities), + e.g. a document object returned from [session.query](../../client-api/session/querying/how-to-query) or from [session.load](../../client-api/session/loading-entities#load). +* Call `documentCounters.delete`. +* Call `session.saveChanges` for the changes to take effect. + +**Note**: + +* A Counter you deleted will be removed only after the execution of `saveChanges()`. +* `delete` will **not** generate an error if the Counter doesn't exist. +* Deleting a document deletes all its Counters as well. + +{PANEL/} + +{PANEL: Syntax} + +{CODE:php Delete-definition@DocumentExtensions\Counters\Counters.php /} + +| Parameter | Type | Description | +|---------------|--------|----------------| +| **counter** | `string` | Counter name ([see example](../../document-extensions/counters/overview#managing-counters)) | + +{PANEL/} + +## Related articles + +**Studio Articles**: +[Studio Counters Management](../../studio/database/document-extensions/counters#counters) + +**Client-API - Session Articles**: +[Counters Overview](../../document-extensions/counters/overview) +[Creating and Modifying Counters](../../document-extensions/counters/create-or-modify) +[Retrieving Counter Values](../../document-extensions/counters/retrieve-counter-values) +[Counters and other features](../../document-extensions/counters/counters-and-other-features) +[Counters In Clusters](../../document-extensions/counters/counters-in-clusters) + +**Client-API - Operations Articles**: +[Counters Operations](../../client-api/operations/counters/get-counters#operations--counters--how-to-get-counters) diff --git a/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/delete.python.markdown b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/delete.python.markdown index a0213d9690..b7c4539519 100644 --- a/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/delete.python.markdown +++ b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/delete.python.markdown @@ -28,7 +28,7 @@ * Pass it an [entity tracked by the session](../../client-api/session/loading-entities), e.g. a document object returned from [session.query](../../client-api/session/querying/how-to-query) or from [session.load](../../client-api/session/loading-entities#load). * Call `document_counters.delete`. -* Call `ession.save_changes` for the changes to take effect. +* Call `session.save_changes` for the changes to take effect. **Note**: diff --git a/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/indexing.php.markdown b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/indexing.php.markdown new file mode 100644 index 0000000000..916a8650e9 --- /dev/null +++ b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/indexing.php.markdown @@ -0,0 +1,74 @@ +# Indexes: Indexing Counters +--- + +{NOTE: } + +* To index counters, create a [static index](../../indexes/creating-and-deploying#static-indexes) +that inherits from `AbstractCountersIndexCreationTask` or `AbstractJavaScriptCountersIndexCreationTask`. + +* Auto-indexes for counters are not available at this time. + +* In this page: + * [Syntax](../../document-extensions/counters/indexing#syntax) + * [AbstractJavaScriptCountersIndexCreationTask](../../document-extensions/counters/indexing#section) + * [CounterNamesFor](../../document-extensions/counters/indexing#section) + +{NOTE/} + +--- + +{PANEL:Syntax} + +To index counter values, create an index that inherits from `AbstractCountersIndexCreationTask` +and set a map as follows. +{CODE:php index_1@DocumentExtensions\Counters\IndexingCounters.php /} + +--- + +### AbstractJavaScriptCountersIndexCreationTask + +Creating an index inheriting from `AbstractJavaScriptCountersIndexCreationTask` allows +you to write your map and reduce functions in JavaScript. +Learn more about JavaScript indexes [here](../../indexes/javascript-indexes). + +{CODE-BLOCK: csharp} +public class AbstractJavaScriptCountersIndexCreationTask : AbstractCountersIndexCreationTask +{ + public HashSet Maps; + protected string Reduce; +} +{CODE-BLOCK/} + +| Property | Type | Description | +| - | - | - | +| **Maps** | `HashSet` | The set of javascript map functions | +| **Reduce** | `string` | The javascript reduce function | + +Example: + +{CODE:php index_3@DocumentExtensions\Counters\IndexingCounters.php /} + +--- + +### `CounterNamesFor` + +While indexes inheriting from `AbstractIndexCreationTask` cannot index counter _values_, the `CounterNamesFor` +method is available which returns the names of all counters for a specified document: + +{CODE:php syntax@DocumentExtensions\Counters\IndexingCounters.php /} + +Example of index using `CounterNamesFor`: + +{CODE:php index_0@DocumentExtensions\Counters\IndexingCounters.php /} + +{PANEL/} + +## Related Articles + +### Indexes +- [Indexing Related Documents](../../indexes/indexing-related-documents) +- [Map-Reduce Indexes](../../indexes/map-reduce-indexes) +- [Creating and Deploying Indexes](../../indexes/creating-and-deploying) + +### Document Extensions +- [Counters: Overview](../../document-extensions/counters/overview) diff --git a/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/overview.php.markdown b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/overview.php.markdown new file mode 100644 index 0000000000..6c23b45c73 --- /dev/null +++ b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/overview.php.markdown @@ -0,0 +1,219 @@ +# Counters Overview + + +{NOTE: } + +* RavenDB's distributed counters, **Counters** for short, are numeric data variables that can be added to documents. + Use a Counter to count anything that needs counting, like: + * Sold products + * Voting results + * Any event related to the document + +* Counters interact with and can trigger other RavenDB features. + To find out how to use counters with other features, read [Counters and Other Features](../../document-extensions/counters/counters-and-other-features). + +* Create and manage Counters using API methods, or through the [Studio](../../studio/database/document-extensions/counters). + +* In this page: + * [Why use Counters?](../../document-extensions/counters/overview#why-use-counters?) + * [Overview](../../document-extensions/counters/overview#overview) + * [Managing Counters](../../document-extensions/counters/overview#managing-counters) + * [Counter Methods and the `countersFor` object](../../document-extensions/counters/overview#counter-methods-and-the--object) + * [Managing Counters using `Operations`](../../document-extensions/counters/overview#managing-counters-using-) +{NOTE/} + +--- + +{PANEL: Why use Counters?} + +#### Convenient Counting Mechanism + +Counters are very easy to manage, using simple API methods or through the Studio. + +E.g. Use counters when you want to - + +- Keep track of the number of times a document has been viewed or rated. +- Count how many visitors from certain countries or regions read a document. +- Continuously record the number of visitors on an event page. +- Avoid having to update the whole document for just a numeric value change. +- Have a need for a high-throughput counter (also see **Distributed Values** below). + +--- + +#### Distributed Values + +A Counter's value is [distributed between cluster nodes](../../document-extensions/counters/counters-in-clusters). +Among the advantages of this: + +* The cluster **remains available** even when nodes crash. +* Any node can provide or modify a Counter's value immediately, without checking or coordinating this with other nodes. + +--- + +#### High Performance, Low Resources + +A document includes the Counter's _name_, while the Counter's actual _value_ is kept in a separate location. +Modifying a Counter's value doesn't require the modification of the document itself. +This results in highly efficient operation. + +--- + +#### High-Frequency Counting + +Counters are especially useful when a very large number of counting operations is required, +because of their speed and low resources usage. + +E.g. Use Counters - + +- For an online election page, to continuously update a Number-Of-Votes Counter for each candidate. +- To continuously update Counters with the number of visitors in different sections of a big online store. + +{PANEL/} + +{PANEL: Overview} + +#### Design + +A document's metadata contains only the ***Counters' names-list*** for this document. +***Counter Values*** are not kept in the document's metadata, but in a separate location. + +Therefore, changes like adding a new counter or deleting an existing counter trigger a document change, +while simply modifying the Counter Value does not. + +--- + +#### Cumulative Counter Actions + +* Counter value-modification actions are cumulative, the order in which they are executed doesn't matter. + E.g., It doesn't matter if a Counter has been incremented by 2 and then by 7, or by 7 first and then by 2. + +* When a Counter is deleted, the sequence of Counter actions becomes non-cumulative and may require + [special attention](../../document-extensions/counters/counters-in-clusters#concurrent-delete-and-increment). + +--- + +#### Counters and Conflicts + +Counter actions (for either name or value) almost never cause conflicts. +The only exception to this is [concurrent `delete` and `increment`](../../document-extensions/counters/counters-in-clusters#concurrent-delete-and-increment) +actions by multiple cluster nodes. + +- Counter actions can be executed concurrently or in any order, without causing a conflict. +- You can successfully modify Counters while their document is being modified by a different client. + +{NOTE: } +Counter actions **can still be performed** when their related documents are in a conflicted state. +{NOTE/} + +--- + +#### Counters Cost + +Counters are designated to lower the cost of counting, but do come with a price. + +* **All the names** of a document's Counters are added to its content, increasing its size. +* **Counter values** occupy storage space. + +{NOTE: } +Be aware that the negligible amount of resources required by a few Counters, +may become significant when there are many. +A single document with thousands of Counters is probably an indication of a modeling mistake, +for example. +{NOTE/} + +--- + +#### Counters Naming Convention + +* Valid characters: All visible characters, [including Unicode symbols](../../studio/database/document-extensions/counters#section) +* Length: Up to 512 bytes +* Encoding: UTF-8 + +--- + +#### Counter Values + +* Valid range: Signed 64-bit integer (-9223372036854775808 to 9223372036854775807) +* Only integer additions are supported (no floats or other mathematical operations). + +--- + +#### Number of Counters Per Document + +RavenDB doesn't limit the number of Counters you can create. + +{NOTE: } +Note that the Counter names are stored in the document metadata and [do impact the size of the document](../../document-extensions/counters/overview#counters-cost). +{NOTE/} + +--- + +#### The `HasCounters` Flag + +When a Counter is added to a document, RavenDB automatically sets a `HasCounters` Flag in the document's metadata. +When all Counters are removed from a document, the server automatically removes this flag. + +{PANEL/} + +{PANEL: Managing Counters} + +#### Counter Methods and the `countersFor` Object + +Managing Counters is performed using the `countersFor` session object. + +* **Counter methods**: + + | Method | Description | + |-------------------------|-----------------------------------------------------------------------------------------| + | `countersFor.increment` | Increment the value of an existing Counter, or create a new Counter if it doesn't exist | + | `countersFor.delete` | Delete a Counter | + | `countersFor.get` | Get the current value of a Counter | + | `countersFor.getAll` | Get *all* the Counters of a document and their values | + + +* **Usage flow**: + * Open a session. + * Create an instance of `countersFor`. + * Either pass `countersFor` an explicit document ID, -or- + * Pass it an [entity tracked by the session](../../client-api/session/loading-entities), + e.g. a document object returned from [session.query](../../client-api/session/querying/how-to-query) or from [session.load](../../client-api/session/loading-entities#load). + * Use Counter methods to manage the document's Counters. + * If you execute [increment](../../document-extensions/counters/create-or-modify) or [delete](../../document-extensions/counters/delete), call `session.saveChanges` for the action to take effect on the server. + +* **Success and failure**: + * As long as the document exists, Counter actions (Increment, Get, Delete etc.) always succeed. + * When a transaction that includes a Counter modification fails for any reason (e.g. a document concurrency conflict), + the Counter modification is reverted. + +* **`countersFor` usage samples**: + * You can Use `countersFor` by **explicitly passing it a document ID** (without pre-loading the document). + * You can also use `countersFor` by passing it **the document object**. + + {CODE-TABS} + {CODE-TAB:php:Pass-CountersFor-Document-ID counters_region_CountersFor_without_document_load@DocumentExtensions\Counters\Counters.php /} + {CODE-TAB:php:Pass-CountersFor-Document-Object counters_region_CountersFor_with_document_load@DocumentExtensions\Counters\Counters.php /} + {CODE-TABS/} + +--- + +#### Managing Counters using `Operations` + +* In addition to working with the high-level Session, you can manage Counters using the low-level [Operations](../../client-api/operations/what-are-operations). + +* [CounterBatchOperation](../../client-api/operations/counters/counter-batch) +can operate on a set of Counters of different documents in a single request. +{PANEL/} + +## Related articles +**Studio Articles**: +[Studio Counters Management](../../studio/database/document-extensions/counters#counters) + +**Client-API - Session Articles**: +[Creating and Modifying Counters](../../document-extensions/counters/create-or-modify) +[Deleting a Counter](../../document-extensions/counters/delete) +[Retrieving Counter Values](../../document-extensions/counters/retrieve-counter-values) +[Counters and other features](../../document-extensions/counters/counters-and-other-features) +[Counters In Clusters](../../document-extensions/counters/counters-in-clusters) + +**Client-API - Operations Articles**: +[Counters Operations](../../client-api/operations/counters/get-counters#operations--counters--how-to-get-counters) diff --git a/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/retrieve-counter-values.php.markdown b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/retrieve-counter-values.php.markdown new file mode 100644 index 0000000000..625ecbd443 --- /dev/null +++ b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/retrieve-counter-values.php.markdown @@ -0,0 +1,107 @@ +# Get Counter Values +--- + +{NOTE: } + +* Use `countersFor.get` to retrieve the values of **specific counters**, + or `countersFor.getAll` to retrieve the names and values of **all counters** associated with a document. + +* For all other `countersFor` methods see this [Overview](../../document-extensions/counters/overview#counter-methods-and-the--object). + +* In this page: + + * [Get values of specific counters](../../document-extensions/counters/retrieve-counter-values#get-values-of-specific-counters) + * [`get` usage](../../document-extensions/counters/retrieve-counter-values#usage) + * [`get` example](../../document-extensions/counters/retrieve-counter-values#example) + * [`get` syntax](../../document-extensions/counters/retrieve-counter-values#syntax) + + * [Get all Counters of a document](../../document-extensions/counters/retrieve-counter-values#get-all-counters-of-a-document) + * [`getAll` usage](../../document-extensions/counters/retrieve-counter-values#usage-1) + * [`getAll` example](../../document-extensions/counters/retrieve-counter-values#example-1) + * [`getAll` Syntax](../../document-extensions/counters/retrieve-counter-values#syntax-1) + +{NOTE/} + +--- + +{PANEL: Get values of specific counters} + +#### `get` usage: + +* Open a session +* Create an instance of `countersFor`. + * Either pass `countersFor` an explicit document ID, -or- + * Pass it an [entity tracked by the session](../../client-api/session/loading-entities), + e.g. a document object returned from [session.query](../../client-api/session/querying/how-to-query) or from [session.load](../../client-api/session/loading-entities#load). +* Call `countersFor.get` to retrieve counter value/s. + * `get("CounterName")` will return a single `int` value for the specified counter. + * `get(["counter1", "counter2"]` will return an array with values for all listed counters. + E.g., `[ "counter1" => 1, "counter2" => 5 ]` + +--- + +#### `get` example: + +{CODE:php counters_region_Get@DocumentExtensions\Counters\Counters.php /} + +--- + +#### `get` syntax: + +{CODE:php Get-definition@DocumentExtensions\Counters\Counters.php /} + +| Parameter | Type | Description | +|---------------|--------|----------------| +| `counters` | `string` or `StringList` or `array` | Counter names | + +| Return Type | Description | +|--------------|-------------------------| +| `int` | Counter's current value | + +{PANEL/} + +{PANEL: Get all Counters of a document} + +--- + +#### `getAll` usage: + +* Open a session. +* Create an instance of `countersFor`. + * Either pass `countersFor` an explicit document ID, -or- + * Pass it an [entity tracked by the session](../../client-api/session/loading-entities), + e.g. a document object returned from [session.query](../../client-api/session/querying/how-to-query) or from [session.load](../../client-api/session/loading-entities#load). +* Call `countersFor.getAll` to retrieve the names and values of all counters associated with the document. + +--- + +#### `getAll` example: + +{CODE:php counters_region_GetAll@DocumentExtensions\Counters\Counters.php /} + +--- + +#### `getAll` syntax: + +{CODE:php GetAll-definition@DocumentExtensions\Counters\Counters.php /} + +| Return Type | Description | +|------------------|-----------------------------| +| `array` | An array of Counter names and values | + +{PANEL/} + +## Related articles + +**Studio Articles**: +[Studio Counters Management](../../studio/database/document-extensions/counters#counters) + +**Client-API - Session Articles**: +[Counters Overview](../../document-extensions/counters/overview) +[Creating and Modifying Counters](../../document-extensions/counters/create-or-modify) +[Deleting a Counter](../../document-extensions/counters/delete) +[Counters and other features](../../document-extensions/counters/counters-and-other-features) +[Counters In Clusters](../../document-extensions/counters/counters-in-clusters) + +**Client-API - Operations Articles**: +[Counters Operations](../../client-api/operations/counters/get-counters#operations--counters--how-to-get-counters) diff --git a/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/retrieve-counter-values.python.markdown b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/retrieve-counter-values.python.markdown index 6ca62c2f4b..93509dc789 100644 --- a/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/retrieve-counter-values.python.markdown +++ b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/counters/retrieve-counter-values.python.markdown @@ -11,14 +11,14 @@ * In this page: * [Get a single Counter's value](../../document-extensions/counters/retrieve-counter-values#get-a-single-counter) - * [Get usage](../../document-extensions/counters/retrieve-counter-values#get-usage) - * [Get example](../../document-extensions/counters/retrieve-counter-values#get-example) - * [Get syntax](../../document-extensions/counters/retrieve-counter-values#get-syntax) + * [`get` usage](../../document-extensions/counters/retrieve-counter-values#usage) + * [`get` example](../../document-extensions/counters/retrieve-counter-values#example) + * [`get` syntax](../../document-extensions/counters/retrieve-counter-values#syntax) * [Get all Counters of a document](../../document-extensions/counters/retrieve-counter-values#get-all-counters-of-a-document) - * [GetAll usage](../../document-extensions/counters/retrieve-counter-values#getall-usage) - * [GetAll example](../../document-extensions/counters/retrieve-counter-values#getall-example) - * [GetAll Syntax](../../document-extensions/counters/retrieve-counter-values#getall-syntax) + * [`get_all` usage](../../document-extensions/counters/retrieve-counter-values#usage-1) + * [`get_all` example](../../document-extensions/counters/retrieve-counter-values#example-1) + * [`get_all` Syntax](../../document-extensions/counters/retrieve-counter-values#syntax-1) {NOTE/} @@ -26,24 +26,24 @@ {PANEL: Get a single Counter's value} -#### Get usage: +#### `get` usage: * Open a session * Create an instance of `counters_for`. * Either pass `counters_for` an explicit document ID, -or- * Pass it an [entity tracked by the session](../../client-api/session/loading-entities), - e.g. a document object returned from [session.Query](../../client-api/session/querying/how-to-query) or from [session.Load](../../client-api/session/loading-entities#load). + e.g. a document object returned from [session.query](../../client-api/session/querying/how-to-query) or from [session.load](../../client-api/session/loading-entities#load). * Call `counters_for.get` to retrieve the current value of a single Counter. --- -#### Get example: +#### `get` example: {CODE:python counters_region_Get@DocumentExtensions\Counters\Counters.py /} --- -#### Get syntax: +#### `get` syntax: {CODE:python Get-definition@DocumentExtensions\Counters\Counters.py /} @@ -61,24 +61,24 @@ --- -#### GetAll usage: +#### `get_all` usage: * Open a session. * Create an instance of `counters_for`. * Either pass `counters_for` an explicit document ID, -or- * Pass it an [entity tracked by the session](../../client-api/session/loading-entities), - e.g. a document object returned from [session.query](../../client-api/session/querying/how-to-query) or from [session.Load](../../client-api/session/loading-entities#load). + e.g. a document object returned from [session.query](../../client-api/session/querying/how-to-query) or from [session.load](../../client-api/session/loading-entities#load). * Call `counters_for.get_all` to retrieve the names and values of all counters associated with the document. --- -#### GetAll example: +#### `get_all` example: {CODE:python counters_region_GetAll@DocumentExtensions\Counters\Counters.py /} --- -#### GetAll syntax: +#### `get_all` syntax: {CODE:python GetAll-definition@DocumentExtensions\Counters\Counters.py /} diff --git a/Documentation/5.4/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/configure-revisions.php.markdown b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/configure-revisions.php.markdown new file mode 100644 index 0000000000..d6725a17dd --- /dev/null +++ b/Documentation/5.4/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/configure-revisions.php.markdown @@ -0,0 +1,99 @@ +# Configure Revisions Operation + +--- + +{NOTE: } + +* Use `ConfigureRevisionsOperation` to apply the following [revisions configuration](../../../../studio/database/settings/document-revisions#revisions-configuration) to the database: + * **Default configuration** - applies to all document collections. + * **Collection-specific configurations** - override the default settings for these collections. + * To apply a configuration for conflict document revisions see [configure conflict revisions](../../../../document-extensions/revisions/client-api/operations/conflict-revisions-configuration). + +* The configuration passed to this operation will **REPLACE** the current revisions configuration in the database. + To **MODIFY** existing configuration, fetch the current configuration from the database record first. + +* After applying the configuration, + revisions are created and purged for a document whenever the document is created, modified, or deleted. + +* To create a revision when there is no configuration defined (or enabled) see: [force revision creation](../../../../document-extensions/revisions/overview#force-revision-creation) + +* By default, the operation will be applied to the [default database](../../../../client-api/setting-up-default-database). + To operate on a different database see [switch operations to different database](../../../../client-api/operations/how-to/switch-operations-to-a-different-database). + +* In this page: + * [Replace configuration](../../../../document-extensions/revisions/client-api/operations/configure-revisions#replace-configuration) + * [Modify configuration](../../../../document-extensions/revisions/client-api/operations/configure-revisions#modify-configuration) + * [Syntax](../../../../document-extensions/revisions/client-api/operations/configure-revisions#syntax) + +{NOTE/} + +--- + +{PANEL: Replace configuration} + +In this example, we create a new `RevisionsConfiguration` for the database. +If revisions configuration already exists in the database - it will be **replaced**. +{CODE:php replace_configuration@DocumentExtensions\Revisions\ClientAPI\Operations\ConfigureRevisions.php /} + +{PANEL/} + +{PANEL: Modify configuration} + +In this example, we fetch the existing revisions configuration from the database record and **modify** it. +{CODE:php modify_configuration@DocumentExtensions\Revisions\ClientAPI\Operations\ConfigureRevisions.php /} + +{PANEL/} + +{PANEL: Syntax} + +{CODE:php syntax_1@DocumentExtensions\Revisions\ClientAPI\Operations\ConfigureRevisions.php /} + +| Parameter | Type | Description | +| - | - | - | +| **configuration** | `?RevisionsConfiguration` | The revisions configuration to apply | + +{CODE:php syntax_2@DocumentExtensions\Revisions\ClientAPI\Operations\ConfigureRevisions.php /} + +| Property | Type | Description | +| - | - | - | +| **defaultConfig** | `RevisionsCollectionConfiguration` | Optional default settings that apply to any collection Not specified in `collections`. | +| **collections** | `null` or `RevisionsCollectionConfigurationArray` or `array` | An array of collection-specific configurations
The `keys` are the collection names
The `values` are the corresponding configurations.
Overrides the default settings for the collections defined. | + +{CODE:php syntax_3@DocumentExtensions\Revisions\ClientAPI\Operations\ConfigureRevisions.php /} + + + +| Property | Type | Description | +| - | - | - | +| **minimumRevisionsToKeep** | `?int` |
  • This number of revisions will be kept per document.
  • Older revisions exceeding this number will be purged upon the next document modification.
  • **Default** : `None` = no limit
| +| **minimumRevisionAgeToKeep** | `?Duration` |