Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion docs/client-api/operations/_what-are-operations-csharp.mdx
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Task<PatchOperation.Result<TEntity>> SendAsync<TEntity>(PatchOperation<TEntity>

* **Revisions**:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [GetRevisionsOperation](../../document-extensions/revisions/client-api/operations/get-revisions.mdx)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [RevertRevisionsByIdOperation](../../document-extensions/revisions/client-api/operations/revert-document-to-revision.mdx)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [RevertRevisionsByIdOperation](../../document-extensions/revisions/revert-documents-to-revisions/revert-documents-to-specific-revisions.mdx#revert-documents-using-an-operation)

* **Patching**:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [PatchOperation](../../client-api/operations/patching/single-document.mdx)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"position": 2,
"label": "Revert Documents to Revisions"
}

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
@@ -1,23 +1,22 @@
---
title: "Revert Document to Revision Operation"
sidebar_label: Revert Document to Revision
sidebar_position: 4
title: "Revert Documents to Specific Revisions"
sidebar_label: "Revert Documents to Specific Revisions"
sidebar_position: 0
---

import LanguageSwitcher from "@site/src/components/LanguageSwitcher";
import LanguageContent from "@site/src/components/LanguageContent";

import RevertDocumentToRevisionCsharp from './_revert-document-to-revision-csharp.mdx';
import RevertDocumentsToSpecificRevisionsCsharp from './_revert-documents-to-specific-revisions-csharp.mdx';

export const supportedLanguages = ["csharp"];

<LanguageSwitcher supportedLanguages={supportedLanguages} />

<LanguageContent language="csharp">
<RevertDocumentToRevisionCsharp />
<RevertDocumentsToSpecificRevisionsCsharp />
</LanguageContent>


<!---
### Document Extensions
- [Revisions Overview](../../../../document-extensions/revisions/overview)
Expand All @@ -33,6 +32,4 @@ export const supportedLanguages = ["csharp"];
### Studio
- [Settings: Document Revisions](../../../../studio/database/settings/document-revisions)
- [Document Extensions: Revisions](../../../../studio/database/document-extensions/revisions)


-->
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
---
title: "Revert Documents to Revisions"
sidebar_label: Revert Documents to Revisions
sidebar_position: 2
title: "Revert Documents to Specific Time"
sidebar_label: "Revert Documents to Specific Time"
sidebar_position: 1
---

import Admonition from '@theme/Admonition';
Expand All @@ -10,8 +10,9 @@ import TabItem from '@theme/TabItem';
import CodeBlock from '@theme/CodeBlock';
import LanguageSwitcher from "@site/src/components/LanguageSwitcher";
import LanguageContent from "@site/src/components/LanguageContent";
import ContentFrame from '@site/src/components/ContentFrame';
import Panel from '@site/src/components/Panel';

# Revert Documents to Revisions
<Admonition type="note" title="">

* You can **revert the database to its state at a specified point in time**
Expand All @@ -21,28 +22,29 @@ import LanguageContent from "@site/src/components/LanguageContent";
or revert documents from all collections as explained below.

* To revert a single document (or multiple documents) to a specific revision,
see [Revert document to revision operation](../../document-extensions/revisions/client-api/operations/revert-document-to-revision.mdx).
see [Revert documents to specific revisions](../../../document-extensions/revisions/revert-documents-to-revisions/revert-documents-to-specific-revisions.mdx).

* Being able to restore the database to a previous state can simplify auditing, enhance understanding of changes made over time,
and facilitate instant recovery without the need to search and retrieve a stored backup.

* In this page:
* [The revisions settings view](../../document-extensions/revisions/revert-revisions.mdx#the-revisions-settings-view)
* [Revert documents](../../document-extensions/revisions/revert-revisions.mdx#revert-documents)
* [Point in time](../../document-extensions/revisions/revert-revisions.mdx#point-in-time)
* [Time Window](../../document-extensions/revisions/revert-revisions.mdx#time-window)
* [Content reverted](../../document-extensions/revisions/revert-revisions.mdx#content-reverted)
* In this article:
* [The revisions settings view](../../../document-extensions/revisions/revert-documents-to-revisions/revert-documents-to-specific-time.mdx#the-revisions-settings-view)
* [Revert documents](../../../document-extensions/revisions/revert-documents-to-revisions/revert-documents-to-specific-time.mdx#revert-documents)
* [Point in time](../../../document-extensions/revisions/revert-documents-to-revisions/revert-documents-to-specific-time.mdx#point-in-time)
* [Time Window](../../../document-extensions/revisions/revert-documents-to-revisions/revert-documents-to-specific-time.mdx#time-window)
* [Content reverted](../../../document-extensions/revisions/revert-documents-to-revisions/revert-documents-to-specific-time.mdx#content-reverted)

</Admonition>
## The revisions settings view

<Panel heading="The revisions settings view">

![Document Revisions View](./assets/revert-revisions-1.png)

1. **The revisions settings view**:
In the Studio, go to _Settings &gt; Document Revisions_. From this view you can:
* [Set](../../studio/database/settings/document-revisions.mdx#revisions-configuration) revision configurations
* [Enforce](../../studio/database/settings/document-revisions.mdx#enforce-configuration) revision configurations
* [Revert](../../document-extensions/revisions/revert-revisions.mdx#revert-documents) documents to revisions
* [Set](../../../studio/database/settings/document-revisions.mdx#revisions-configuration) revision configurations
* [Enforce](../../../studio/database/settings/document-revisions.mdx#enforce-configuration) revision configurations
* [Revert](../../../document-extensions/revisions/revert-documents-to-revisions/revert-documents-to-specific-time.mdx#revert-documents) documents to revisions

2. **Revision configurations**:
* The ability to revert documents to their past revisions depends on revisions being created.
Expand All @@ -51,23 +53,23 @@ import LanguageContent from "@site/src/components/LanguageContent";
* Make sure that a configuration that suits your needs is defined.

3. **Revert documents**:
Click the _Revert Revisions_ button to revert documents from all or selected collections to a specified point in time.
Learn more [below](../../document-extensions/revisions/revert-revisions.mdx#revert-documents).

Click the _Revert Revisions_ button to revert documents from all or selected collections to a specified point in time.
Learn more [below](../../../document-extensions/revisions/revert-documents-to-revisions/revert-documents-to-specific-time.mdx#revert-documents).

</Panel>

## Revert documents
<Panel heading="Revert documents">

![Revert Revisions](./assets/revert-revisions-2.png)

1. Enter the **Point in Time** to which you would like to revert the documents. Learn more [below](../../document-extensions/revisions/revert-revisions.mdx#point-in-time).
1. Enter the **Point in Time** to which you would like to revert the documents. Learn more [below](../../../document-extensions/revisions/revert-documents-to-revisions/revert-documents-to-specific-time.mdx#point-in-time).

2. Enter the **Time Window**. Learn more [below](../../document-extensions/revisions/revert-revisions.mdx#time-window).
2. Enter the **Time Window**. Learn more [below](../../../document-extensions/revisions/revert-documents-to-revisions/revert-documents-to-specific-time.mdx#time-window).

3. Revert **All collections** in the database, or toggle to select **Specific collections** to revert.



---
## Point in time

![Set point in time](./assets/set-point-in-time.png)
Expand All @@ -89,7 +91,7 @@ import LanguageContent from "@site/src/components/LanguageContent";
* Any of these documents that own revisions will be **reverted**
to the revision created at the specified Point in Time or to the latest revision preceding this time.

* When [setting a limit](../../studio/database/settings/document-revisions.mdx#limit-revisions) on the number of revisions that are kept (by number or by age)
* When [setting a limit](../../../studio/database/settings/document-revisions.mdx#limit-revisions) on the number of revisions that are kept (by number or by age)
then only the most recent revisions are kept for the document.
If all of these revisions were created AFTER the Point in Time then the oldest revision will be
the one we revert to, even though that revision is newer than the specified time.
Expand All @@ -104,8 +106,8 @@ import LanguageContent from "@site/src/components/LanguageContent";

</Admonition>



---
## Time window

* Revisions are ordered in the _revisions storage_ by their change-vector, and Not by creation time.
Expand Down Expand Up @@ -146,7 +148,7 @@ import LanguageContent from "@site/src/components/LanguageContent";
| 6) `Users/1` | 13.2.2023 01:00 | =&gt; Document Users/1 will be reverted to this revision |
| 7) `Users/5` | 11.2.2023 01:00 | =&gt; Document Users/5 will be reverted to this revision + <br/>STOP the search for more Users/5 revisions |
| 8) `Users/5` | 11.2.2023 03:00 | |
| 9) `Users/9` | 10.2.2023 01:00 | =&gt; Document Users/9 will Not be reverted to this revision + <br/>STOP the search in this list |
| 9) `Users/9` | 10.2.2023 01:00 | =&gt; Document Users/9 will Not be reverted to this revision + <br/>STOP the search in this list |
| 10) `Users/6` | 11.2.2023 01:00 | |
| . . . | | |

Expand Down Expand Up @@ -178,7 +180,7 @@ import LanguageContent from "@site/src/components/LanguageContent";

</Admonition>


---

## Content reverted

Expand All @@ -192,15 +194,14 @@ import LanguageContent from "@site/src/components/LanguageContent";

* Document extensions:
* **Time series**
Time series data is Not reverted. Learn more [here](../../document-extensions/revisions/revisions-and-other-features.mdx#reverted-data-1).
Time series data is Not reverted. Learn more [here](../../../document-extensions/revisions/revisions-and-other-features.mdx#reverted-data-1).
* **Attachments**
When a document is reverted to a revision that owns attachments,
the attachments are restored to their state when the revision was created.
* **Counters**
When a document is reverted to a revision that owns counters,
the counters are restored to functionality along with their values from that revision.

</Admonition>


</Admonition>

</Panel>
Original file line number Diff line number Diff line change
Expand Up @@ -160,7 +160,7 @@ Task<PatchOperation.Result<TEntity>> SendAsync<TEntity>(PatchOperation<TEntity>

* **Revisions**:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [GetRevisionsOperation](../../document-extensions/revisions/client-api/operations/get-revisions.mdx)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [RevertRevisionsByIdOperation](../../document-extensions/revisions/client-api/operations/revert-document-to-revision.mdx)
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [RevertRevisionsByIdOperation](../../document-extensions/revisions/revert-documents-to-revisions/revert-documents-to-specific-revisions.mdx#revert-documents-using-an-operation)

* **Patching**:
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp; [PatchOperation](../../client-api/operations/patching/single-document.mdx)
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
{
"position": 2,
"label": "Revert Documents to Revisions"
}
Loading