Skip to content

Commit

Permalink
Merge pull request #1869 from reebhub/Python_DocExt1_Rev
Browse files Browse the repository at this point in the history
[Python] Document-extensions pages batch - revisions [Replace C# samples]
  • Loading branch information
ppekrol committed Jul 10, 2024
2 parents f4118a0 + 401b300 commit 68b23e4
Show file tree
Hide file tree
Showing 109 changed files with 7,287 additions and 494 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
{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.
* **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.
* 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.
Expand All @@ -32,7 +32,7 @@
{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__.
If revisions configuration already exists in the database - it will be **replaced**.

{CODE-TABS}
{CODE-TAB:csharp:Sync replace_configuration@DocumentExtensions\Revisions\ClientAPI\Operations\ConfigureRevisions.cs /}
Expand All @@ -43,7 +43,7 @@

{PANEL: Modify configuration}

* In this example, we fetch the existing revisions configuration from the database record and __modify__ it.
* In this example, we fetch the existing revisions configuration from the database record and **modify** it.

{CODE-TABS}
{CODE-TAB:csharp:Sync modify_configuration@DocumentExtensions\Revisions\ClientAPI\Operations\ConfigureRevisions.cs /}
Expand All @@ -58,26 +58,26 @@

| Parameter | Type | Description |
| - | - | - |
| __configuration__ | `RevisionsConfiguration` | The revisions configuration to apply |
| **configuration** | `RevisionsConfiguration` | The revisions configuration to apply |

{CODE:csharp syntax_2@DocumentExtensions\Revisions\ClientAPI\Operations\ConfigureRevisions.cs /}

| Property | Type | Description |
| - | - | - |
| __Default__ | `RevisionsCollectionConfiguration` | Optional default settings that apply to any collection Not specified in `Collections`. |
| __Collections__ | `Dictionary<string, RevisionsCollectionConfiguration>` | A Dictionary of collection-specific configurations<br>The `keys` are the collection names<br>The `values` are the corresponding configurations.<br>Overrides the default settings for the collections defined. |
| **Default** | `RevisionsCollectionConfiguration` | Optional default settings that apply to any collection Not specified in `Collections`. |
| **Collections** | `Dictionary<string, RevisionsCollectionConfiguration>` | A Dictionary of collection-specific configurations<br>The `keys` are the collection names<br>The `values` are the corresponding configurations.<br>Overrides the default settings for the collections defined. |

{CODE:csharp syntax_3@DocumentExtensions\Revisions\ClientAPI\Operations\ConfigureRevisions.cs /}

<a id="revisions-collection-configuration-object" />

| Property | Type | Description |
| - | - | - |
| __MinimumRevisionsToKeep__ | `long` | <ul><li>This number of revisions will be kept per document.</li><li>Older revisions exceeding this number will be purged upon the next document modification.<li> __Default__ : `null` = no limit </li></ul> |
| __MinimumRevisionAgeToKeep__ | `TimeSpan` | <ul><li>Limit the number of revisions kept per document by their age.</li><li>Revisions that are older than this time will be purged upon the next document modification.</li><li> __Default__ : `null` = no age limit</li><ul> |
| __MaximumRevisionsToDeleteUponDocumentUpdate__ | `long` | <ul><li>The maximum number of revisions to delete upon each document modification.</li><li> __Default__ : `null` = no limit,<br> all revisions that pend purging will be deleted.</li></ul> |
| __PurgeOnDelete__ | `bool` | <ul><li>`false` ( __Default__ ) - Revisions of a deleted document are moved to the [Revisions Bin](../../../../studio/database/document-extensions/revisions#revisions-bin).</li><li>`true` - When a document is deleted all its revisions are also deleted.</li></ul> |
| __Disabled__ | `bool` | <ul><li>`false` ( __Default__ ) - Revisions will be created and purged according to the configuration.</li><li>`true` - No revisions will be created or purged.</li></ul> |
| **MinimumRevisionsToKeep** | `long` | <ul><li>This number of revisions will be kept per document.</li><li>Older revisions exceeding this number will be purged upon the next document modification.<li> **Default** : `null` = no limit </li></ul> |
| **MinimumRevisionAgeToKeep** | `TimeSpan` | <ul><li>Limit the number of revisions kept per document by their age.</li><li>Revisions that are older than this time will be purged upon the next document modification.</li><li> **Default** : `null` = no age limit</li><ul> |
| **MaximumRevisionsToDeleteUponDocumentUpdate** | `long` | <ul><li>The maximum number of revisions to delete upon each document modification.</li><li> **Default** : `null` = no limit,<br> all revisions that pend purging will be deleted.</li></ul> |
| **PurgeOnDelete** | `bool` | <ul><li>`false` ( **Default** ) - Revisions of a deleted document are moved to the [Revisions Bin](../../../../studio/database/document-extensions/revisions#revisions-bin).</li><li>`true` - When a document is deleted all its revisions are also deleted.</li></ul> |
| **Disabled** | `bool` | <ul><li>`false` ( **Default** ) - Revisions will be created and purged according to the configuration.</li><li>`true` - No revisions will be created or purged.</li></ul> |

{PANEL/}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@
{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.
* **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.
* 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.
Expand All @@ -32,15 +32,15 @@
{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__.
If revisions configuration already exists in the database - it will be **replaced**.

{CODE:nodejs replace_configuration@document-extensions\revisions\client-api\operations\configureRevisions.js /}

{PANEL/}

{PANEL: Modify configuration}

* In this example, we fetch the existing revisions configuration from the database record and __modify__ it.
* In this example, we fetch the existing revisions configuration from the database record and **modify** it.

{CODE:nodejs modify_configuration@document-extensions\revisions\client-api\operations\configureRevisions.js /}

Expand All @@ -52,26 +52,26 @@

| Parameter | Type | Description |
| - | - | - |
| __configuration__ | `RevisionsConfiguration` | The revisions configuration to apply |
| **configuration** | `RevisionsConfiguration` | The revisions configuration to apply |

{CODE:nodejs syntax_2@document-extensions\revisions\client-api\operations\configureRevisions.js /}

| Property | Type | Description |
| - | - | - |
| __defaultConfig__ | `RevisionsCollectionConfiguration` | Optional default settings that apply to any collection Not specified in `collections`. |
| __collections__ | `Dictionary<string, RevisionsCollectionConfiguration>` | A Dictionary of collection-specific configurations<br>The `keys` are the collection names<br>The `values` are the corresponding configurations.<br>Overrides the default settings for the collections defined. |
| **defaultConfig** | `RevisionsCollectionConfiguration` | Optional default settings that apply to any collection Not specified in `collections`. |
| **collections** | `Dictionary<string, RevisionsCollectionConfiguration>` | A Dictionary of collection-specific configurations<br>The `keys` are the collection names<br>The `values` are the corresponding configurations.<br>Overrides the default settings for the collections defined. |

{CODE:nodejs syntax_3@document-extensions\revisions\client-api\operations\configureRevisions.js /}

<a id="revisions-collection-configuration-object" />

| Property | Type | Description |
| - | - | - |
| __minimumRevisionsToKeep__ | `number` | <ul><li>This number of revisions will be kept per document.</li><li>Older revisions exceeding this number will be purged upon the next document modification.<li> __Default__ : `null` = no limit </li></ul> |
| __minimumRevisionAgeToKeep__ | `string` | <ul><li>Limit the number of revisions kept per document by their age.</li><li>Revisions that are older than this time will be purged upon the next document modification.</li><li> __Default__ : `null` = no age limit</li><ul> |
| __maximumRevisionsToDeleteUponDocumentUpdate__ | `number` | <ul><li>The maximum number of revisions to delete upon each document modification.</li><li> __Default__ : `null` = no limit,<br> all revisions that pend purging will be deleted.</li></ul> |
| __purgeOnDelete__ | `boolean` | <ul><li>`false` ( __Default__ ) - Revisions of a deleted document are moved to the [Revisions Bin](../../../../studio/database/document-extensions/revisions#revisions-bin).</li><li>`true` - When a document is deleted all its revisions are also deleted.</li></ul> |
| __disabled__ | `boolean` | <ul><li>`false` ( __Default__ ) - Revisions will be created and purged according to the configuration.</li><li>`true` - No revisions will be created or purged.</li></ul> |
| **minimumRevisionsToKeep** | `number` | <ul><li>This number of revisions will be kept per document.</li><li>Older revisions exceeding this number will be purged upon the next document modification.<li> **Default** : `null` = no limit </li></ul> |
| **minimumRevisionAgeToKeep** | `string` | <ul><li>Limit the number of revisions kept per document by their age.</li><li>Revisions that are older than this time will be purged upon the next document modification.</li><li> **Default** : `null` = no age limit</li><ul> |
| **maximumRevisionsToDeleteUponDocumentUpdate** | `number` | <ul><li>The maximum number of revisions to delete upon each document modification.</li><li> **Default** : `null` = no limit,<br> all revisions that pend purging will be deleted.</li></ul> |
| **purgeOnDelete** | `boolean` | <ul><li>`false` ( **Default** ) - Revisions of a deleted document are moved to the [Revisions Bin](../../../../studio/database/document-extensions/revisions#revisions-bin).</li><li>`true` - When a document is deleted all its revisions are also deleted.</li></ul> |
| **disabled** | `boolean` | <ul><li>`false` ( **Default** ) - Revisions will be created and purged according to the configuration.</li><li>`true` - No revisions will be created or purged.</li></ul> |

{PANEL/}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{NOTE: }

* By default, RavenDB creates __revisions for conflict documents__ for all collections
* By default, RavenDB creates **revisions for conflict documents** for all collections
when conflicts occur and when they are resolved.

* Use `ConfigureRevisionsForConflictsOperation` to disable the feature or modify the configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@

{NOTE: }

* By default, RavenDB creates __revisions for conflict documents__ for all collections
* By default, RavenDB creates **revisions for conflict documents** for all collections
when conflicts occur and when they are resolved.

* Use `ConfigureRevisionsForConflictsOperation` to disable the feature or modify the configuration.
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

* For a general revisions overview see: [Revisions Overview](../../../document-extensions/revisions/overview).

* Document revisions can be managed from the [Studio](../../../studio/database/settings/document-revisions) or from the __Client API__.
* Document revisions can be managed from the [Studio](../../../studio/database/settings/document-revisions) or from the **Client API**.

* From the __Client API__, revisions can be configured and managed by:
* From the **Client API**, revisions can be configured and managed by:
* [Store Operations](../../../document-extensions/revisions/client-api/overview#revisions-store-operations)
* [Session Methods](../../../document-extensions/revisions/client-api/overview#revisions-session-methods)

Expand All @@ -26,29 +26,29 @@

{PANEL: Revisions Session methods}

* __Get revisions__:
* **Get revisions**:

* [GetFor](../../../document-extensions/revisions/client-api/session/loading#get-all-revisions) - retrieve all revisions kept for a document.
* [GetMetadataFor](../../../document-extensions/revisions/client-api/session/loading#get-revisions-metadata) - retrieve metadata for all revisions kept for a document.
* [Get](../../../document-extensions/revisions/client-api/session/loading#get-revisions-by-creation-time) - retrieve revisions by change vector or creation time.
* Read [here](../../../client-api/session/how-to/perform-operations-lazily#getRevisions) about __lazy versions__ of `GetFor`, `GetMetadataFor`, and `Get`.
* Read [here](../../../client-api/session/how-to/perform-operations-lazily#getRevisions) about **lazy versions** of `GetFor`, `GetMetadataFor`, and `Get`.

---

* __Include revisions__:
* **Include revisions**:

* [IncludeRevisions](../../../document-extensions/revisions/client-api/session/including#section) - include revisions when retrieving documents via `Session.Load` or `Session.Query`.
* [RawQuery](../../../document-extensions/revisions/client-api/session/including#including-revisions-with-session.advanced.rawquery) - Learn how to include revisions when retrieving documents via raw queries.

---

* __Count revisions__:
* **Count revisions**:

* [GetCountFor](../../../document-extensions/revisions/client-api/session/counting#getcountfor) - get the number of revisions kept for a document.

---

* __Force revision creation__:
* **Force revision creation**:

* [ForceRevisionCreationFor](../../../document-extensions/revisions/overview#force-revision-creation-via-api) - create a revision even if revision configuration is disabled.

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,9 +6,9 @@

* For a general revisions overview see: [Revisions Overview](../../../document-extensions/revisions/overview).

* Document revisions can be managed from the [Studio](../../../studio/database/settings/document-revisions) or from the __Client API__.
* Document revisions can be managed from the [Studio](../../../studio/database/settings/document-revisions) or from the **Client API**.

* From the __Client API__, revisions can be configured and managed by:
* From the **Client API**, revisions can be configured and managed by:
* [Store Operations](../../../document-extensions/revisions/client-api/overview#revisions-store-operations)
* [Session Methods](../../../document-extensions/revisions/client-api/overview#revisions-session-methods)

Expand All @@ -26,29 +26,29 @@

{PANEL: Revisions Session methods}

* __Get revisions__:
* **Get revisions**:

* [getFor](../../../document-extensions/revisions/client-api/session/loading#get-all-revisions) - retrieve all revisions kept for a document.
* [getMetadataFor](../../../document-extensions/revisions/client-api/session/loading#get-revisions-metadata) - retrieve metadata for all revisions kept for a document.
* [get](../../../document-extensions/revisions/client-api/session/loading#get-revisions-by-creation-time) - retrieve revisions by change vector or creation time.
* Read [here](../../../client-api/session/how-to/perform-operations-lazily#getRevisions) about __lazy versions__ of `getFor`, `getMetadataFor`, and `get`.
* Read [here](../../../client-api/session/how-to/perform-operations-lazily#getRevisions) about **lazy versions** of `getFor`, `getMetadataFor`, and `get`.

---

* __Include revisions__:
* **Include revisions**:

* [includeRevisions](../../../document-extensions/revisions/client-api/session/including#section) - include revisions when retrieving documents via `session.load` or `session.query`.
* [rawQuery](../../../document-extensions/revisions/client-api/session/including#including-revisions-with-session.advanced.rawquery) - Learn how to include revisions when retrieving documents via raw queries.

---

* __Count revisions__:
* **Count revisions**:

* [getCountFor](../../../document-extensions/revisions/client-api/session/counting#getcountfor) - get the number of revisions kept for a document.

---

* __Force revision creation__:
* **Force revision creation**:

* [forceRevisionCreationFor](../../../document-extensions/revisions/overview#force-revision-creation-via-api) - create a revision even if revision configuration is disabled.

Expand Down
Loading

0 comments on commit 68b23e4

Please sign in to comment.