diff --git a/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.dotnet.markdown b/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.dotnet.markdown
index cd6da073e4..f87191bce7 100644
--- a/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.dotnet.markdown
+++ b/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.dotnet.markdown
@@ -14,8 +14,7 @@
* In this page:
* [Why use operations](../../client-api/operations/what-are-operations#why-use-operations)
- * [How operations work](../../client-api/operations/what-are-operations#how-operations-work)
-
+ * [How operations work](../../client-api/operations/what-are-operations#how-operations-work)
* **Operation types**:
* [Common operations](../../client-api/operations/what-are-operations#common-operations)
* [Maintenance operations](../../client-api/operations/what-are-operations#maintenance-operations)
@@ -256,6 +255,7 @@
* **Revisions**:
[ConfigureRevisionsOperation](../../document-extensions/revisions/client-api/operations/configure-revisions)
+ [DeleteRevisionsOperation](../../document-extensions/revisions/client-api/operations/delete-revisions)
* **Sorters**:
[PutSortersOperation](../../client-api/operations/maintenance/sorters/put-sorter)
diff --git a/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.js.markdown b/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.js.markdown
index 5b6165b80e..d21f5e12b1 100644
--- a/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.js.markdown
+++ b/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.js.markdown
@@ -15,7 +15,6 @@
* In this page:
* [Why use operations](../../client-api/operations/what-are-operations#why-use-operations)
* [How operations work](../../client-api/operations/what-are-operations#how-operations-work)
-
* __Operation types__:
* [Common operations](../../client-api/operations/what-are-operations#common-operations)
* [Maintenance operations](../../client-api/operations/what-are-operations#maintenance-operations)
diff --git a/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.php.markdown b/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.php.markdown
index a7b70829ec..a9c759f0f2 100644
--- a/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.php.markdown
+++ b/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.php.markdown
@@ -15,7 +15,6 @@
* In this page:
* [Why use operations](../../client-api/operations/what-are-operations#why-use-operations)
* [How operations work](../../client-api/operations/what-are-operations#how-operations-work)
-
* **Operation types**:
* [Common operations](../../client-api/operations/what-are-operations#common-operations)
* [Maintenance operations](../../client-api/operations/what-are-operations#maintenance-operations)
diff --git a/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.python.markdown b/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.python.markdown
index 836fd8a588..a957a40807 100644
--- a/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.python.markdown
+++ b/Documentation/6.2/Raven.Documentation.Pages/client-api/operations/what-are-operations.python.markdown
@@ -15,7 +15,6 @@
* In this page:
* [Why use operations](../../client-api/operations/what-are-operations#why-use-operations)
* [How operations work](../../client-api/operations/what-are-operations#how-operations-work)
-
* **Operation types**:
* [Common operations](../../client-api/operations/what-are-operations#common-operations)
* [Maintenance operations](../../client-api/operations/what-are-operations#maintenance-operations)
diff --git a/Documentation/6.2/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/.docs.json b/Documentation/6.2/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/.docs.json
index 00a381f5dc..56d2a878a5 100644
--- a/Documentation/6.2/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/.docs.json
+++ b/Documentation/6.2/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/.docs.json
@@ -50,5 +50,11 @@
"Key": "client-api/operations/revisions/get-revisions"
}
]
+ },
+ {
+ "Path": "delete-revisions.markdown",
+ "Name": "Delete Revisions",
+ "DiscussionId": "f447c943-de2f-4f55-bec4-625dd8e4094a",
+ "Mappings": []
}
]
diff --git a/Documentation/6.2/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/delete-revisions.dotnet.markdown b/Documentation/6.2/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/delete-revisions.dotnet.markdown
new file mode 100644
index 0000000000..5e4f80dc6d
--- /dev/null
+++ b/Documentation/6.2/Raven.Documentation.Pages/document-extensions/revisions/client-api/operations/delete-revisions.dotnet.markdown
@@ -0,0 +1,116 @@
+# Delete Revisions Operation
+---
+
+{NOTE: }
+
+* Use `DeleteRevisionsOperation` to delete document revisions.
+ The document itself is not deleted, only its revisions will be deleted, as specified by the operation's params.
+
+* Existing revisions will be deleted regardless of the current [revisions settings](../../../../studio/database/settings/document-revisions),
+ even if these settings are disabled.
+
+* When working with a secure server:
+ * The delete revisions action will be logged in the [audit log](../../../../server/security/audit-log/audit-log).
+ * This operation is only available for a client certificate with a [security clearance](../../../../server/security/authorization/security-clearance-and-permissions) of _DatabaseAdmin_ or higher.
+
+* 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:
+ * [Delete all revisions - single document](../../../../document-extensions/revisions/client-api/operations/delete-revisions#delete-all-revisions---single-document)
+ * [Delete revisions - multiple documents](../../../../document-extensions/revisions/client-api/operations/delete-revisions#delete-revisions---multiple-documents)
+ * [Delete revisions by time frame](../../../../document-extensions/revisions/client-api/operations/delete-revisions#delete-revisions-by-time-frame)
+ * [Delete revisions by change vectors](../../../../document-extensions/revisions/client-api/operations/delete-revisions#delete-revisions-by-change-vectors)
+ * [Syntax](../../../../document-extensions/revisions/client-api/operations/delete-revisions#syntax)
+
+{NOTE/}
+
+---
+
+{PANEL: Delete all revisions - single document}
+
+In this example, we delete ALL revisions of a document.
+Both types of revisions, those resulting from the [revisions settings](../../../../studio/database/settings/document-revisions) and those generated manually via
+[force revision creation](../../../../document-extensions/revisions/overview#force-revision-creation), will be deleted.
+
+{CODE-TABS}
+{CODE-TAB:csharp:Sync delete_revisions_1@DocumentExtensions\Revisions\ClientAPI\Operations\DeleteRevisions.cs /}
+{CODE-TAB:csharp:Async delete_revisions_1_async@DocumentExtensions\Revisions\ClientAPI\Operations\DeleteRevisions.cs /}
+{CODE-TABS/}
+
+{PANEL/}
+
+{PANEL: Delete revisions - multiple documents}
+
+You can specify multiple documents from which to delete revisions.
+
+{CODE-TABS}
+{CODE-TAB:csharp:Sync delete_revisions_2@DocumentExtensions\Revisions\ClientAPI\Operations\DeleteRevisions.cs /}
+{CODE-TAB:csharp:Async delete_revisions_2_async@DocumentExtensions\Revisions\ClientAPI\Operations\DeleteRevisions.cs /}
+{CODE-TABS/}
+
+{PANEL/}
+
+{PANEL: Delete revisions by time frame}
+
+You can specify a time frame from which to delete revisions.
+Only revisions that were created within that time frame (inclusive) will be deleted.
+The time should be specified in UTC.
+
+{CODE-TABS}
+{CODE-TAB:csharp:Sync delete_revisions_3@DocumentExtensions\Revisions\ClientAPI\Operations\DeleteRevisions.cs /}
+{CODE-TAB:csharp:Async delete_revisions_3_async@DocumentExtensions\Revisions\ClientAPI\Operations\DeleteRevisions.cs /}
+{CODE-TABS/}
+
+{PANEL/}
+
+{PANEL: Delete revisions by change vectors}
+
+Each revision has its own unique [change vector](../../../../document-extensions/revisions/client-api/session/loading#get-revisions-by-change-vector).
+You can specify which revisions to delete by providing their corresponding change vectors.
+
+{CODE-TABS}
+{CODE-TAB:csharp:Sync delete_revisions_4@DocumentExtensions\Revisions\ClientAPI\Operations\DeleteRevisions.cs /}
+{CODE-TAB:csharp:Async delete_revisions_4_async@DocumentExtensions\Revisions\ClientAPI\Operations\DeleteRevisions.cs /}
+{CODE-TABS/}
+
+{PANEL/}
+
+{PANEL: Syntax}
+
+{CODE:csharp syntax_1@DocumentExtensions\Revisions\ClientAPI\Operations\DeleteRevisions.cs /}
+
+| Parameter | Type | Description |
+|---------------------------------|----------------|---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------|
+| **documentId** | `string` | The ID of the document whose revisions you want to delete. |
+| **documentIds** | `List` | A list of document IDs whose revisions you want to delete. |
+| **removeForceCreatedRevisions** | `bool` | `true` - Include [force-created revisions](../../../../document-extensions/revisions/overview#force-revision-creation) in the deletion.
`false` - Exclude force-created revisions. |
+| **from** | `DateTime` | The start date of the range for revisions to delete (inclusive). |
+| **to** | `DateTime` | The end date of the range for revisions to delete (inclusive). |
+| **revisionsChangeVectors** | `List` | A list of change vectors corresponding to the revisions that you want to delete. |
+
+{PANEL/}
+
+## Related Articles
+
+### Document Extensions
+
+* [Revisions Overview](../../../../document-extensions/revisions/overview)
+* [Revert Revisions](../../../../document-extensions/revisions/revert-revisions)
+* [Revisions and Other Features](../../../../document-extensions/revisions/revisions-and-other-features)
+* [Revisions: API Overview](../../../../document-extensions/revisions/client-api/overview)
+* [Session: Loading Revisions](../../../../document-extensions/revisions/client-api/session/loading)
+* [Session: Including Revisions](../../../../document-extensions/revisions/client-api/session/including)
+* [Session: Counting Revisions](../../../../document-extensions/revisions/client-api/session/counting)
+
+### Client API
+
+* [What Are Operations](../../../../client-api/operations/what-are-operations)
+* [Switch Operation Database](../../../../client-api/operations/how-to/switch-operations-to-a-different-database)
+* [Setting Up a Default Database](../../../../client-api/setting-up-default-database)
+
+### Studio
+
+* [Settings: Document Revisions](../../../../studio/database/settings/document-revisions)
+* [Document Extensions: Revisions](../../../../studio/database/document-extensions/revisions)
+* [Manage Database Group](../../../../studio/database/settings/manage-database-group)
diff --git a/Documentation/6.2/Samples/csharp/Raven.Documentation.Samples/DocumentExtensions/Revisions/ClientAPI/Operations/DeleteRevisions.cs b/Documentation/6.2/Samples/csharp/Raven.Documentation.Samples/DocumentExtensions/Revisions/ClientAPI/Operations/DeleteRevisions.cs
new file mode 100644
index 0000000000..b578924111
--- /dev/null
+++ b/Documentation/6.2/Samples/csharp/Raven.Documentation.Samples/DocumentExtensions/Revisions/ClientAPI/Operations/DeleteRevisions.cs
@@ -0,0 +1,192 @@
+using System;
+using System.Collections.Generic;
+using System.Linq;
+using System.Threading.Tasks;
+using Raven.Client;
+using Raven.Client.Documents;
+using Raven.Client.Documents.Operations.Revisions;
+using Xunit;
+
+namespace Raven.Documentation.Samples.DocumentExtensions.Revisions.ClientAPI.Operations
+{
+ public class DeleteRevisions
+ {
+ public DeleteRevisions()
+ {
+ using (var store = new DocumentStore())
+ {
+ #region delete_revisions_1
+ // Define the delete revisions operation:
+
+ // Delete ALL existing revisions for document "orders/830-A"
+ var deleteRevisionsOp = new DeleteRevisionsOperation(documentId: "orders/830-A",
+ // Revisions that were created manually will also be removed
+ removeForceCreatedRevisions: true);
+
+ // Execute the operation by passing it to Maintenance.Send
+ var numberOfRevisionsDeleted = store.Maintenance.Send(deleteRevisionsOp);
+
+ // Running the above code on RavenDB's sample data results in the removal of 29 revisions
+ Assert.Equal(29, numberOfRevisionsDeleted.TotalDeletes);
+ #endregion
+ }
+
+ using (var store = new DocumentStore())
+ {
+ #region delete_revisions_2
+ // Delete existing revisions for the specified documents
+ var deleteRevisionsOp = new DeleteRevisionsOperation(
+ documentIds: new List() { "orders/829-A", "orders/828-A", "orders/827-A" },
+ // Revisions that were created manually will Not be removed
+ removeForceCreatedRevisions: false);
+
+ var numberOfRevisionsDeleted = store.Maintenance.Send(deleteRevisionsOp);
+
+ // Running the above on RavenDB's sample data results in the removal of 19 revisions
+ Assert.Equal(19, numberOfRevisionsDeleted.TotalDeletes);
+ #endregion
+ }
+
+ using (var store = new DocumentStore())
+ {
+ #region delete_revisions_3
+ var deleteFrom = DateTime.Parse("2018-07-27T09:11:52.0Z");
+ var deleteTo = DateTime.Parse("2018-07-27T09:11:54.0Z");
+
+ // Delete existing revisions within the specified time frame
+ var deleteRevisionsOp =
+ new DeleteRevisionsOperation(documentId: "orders/826-A", from: deleteFrom, to: deleteTo);
+
+ var numberOfRevisionsDeleted = store.Maintenance.Send(deleteRevisionsOp);
+ #endregion
+ }
+
+ using (var store = new DocumentStore())
+ {
+ using (var session = store.OpenSession())
+ {
+ #region delete_revisions_4
+ // Get the change-vectors for the revisions of the specified document
+ var revisionsChangeVectors = session.Advanced.Revisions
+ .GetMetadataFor("orders/825-A")
+ .Select(m => m.GetString(Constants.Documents.Metadata.ChangeVector))
+ .ToList();
+
+ // Delete the revisions by their change-vector
+ var revisionToDelete =
+ new List() { revisionsChangeVectors[0], revisionsChangeVectors[1] };
+
+ var deleteRevisionsOp =
+ new DeleteRevisionsOperation(documentId: "orders/825-A", revisionToDelete);
+
+ var numberOfRevisionsDeleted = store.Maintenance.Send(deleteRevisionsOp);
+ #endregion
+ }
+ }
+ }
+
+ public async Task ConfigRevisionsAsync()
+ {
+ using (var store = new DocumentStore())
+ {
+ #region delete_revisions_1_async
+ // Define the delete revisions operation:
+
+ // Delete ALL existing revisions for document "orders/830-A"
+ var deleteRevisionsOp = new DeleteRevisionsOperation(documentId: "orders/830-A",
+ // Revisions that were created manually will also be removed
+ removeForceCreatedRevisions: true);
+
+ // Execute the operation by passing it to Maintenance.SendAsync
+ var numberOfRevisionsDeleted = await store.Maintenance.SendAsync(deleteRevisionsOp);
+
+ // Running the above code on RavenDB's sample data results in the removal of 29 revisions
+ Assert.Equal(29, numberOfRevisionsDeleted.TotalDeletes);
+ #endregion
+ }
+
+ using (var store = new DocumentStore())
+ {
+
+ #region delete_revisions_2_async
+ // Delete existing revisions for the specified documents
+ var deleteRevisionsOp = new DeleteRevisionsOperation(
+ documentIds: new List() { "orders/829-A", "orders/828-A", "orders/827-A" },
+ // Revisions that were created manually will Not be removed
+ removeForceCreatedRevisions: false);
+
+ var numberOfRevisionsDeleted = await store.Maintenance.SendAsync(deleteRevisionsOp);
+
+ // Running the above on RavenDB's sample data results in the removal of 19 revisions
+ Assert.Equal(19, numberOfRevisionsDeleted.TotalDeletes);
+ #endregion
+ }
+
+ using (var store = new DocumentStore())
+ {
+ #region delete_revisions_3_async
+ var deleteFrom = DateTime.Parse("2018-07-27T09:11:52.0Z");
+ var deleteTo = DateTime.Parse("2018-07-27T09:11:54.0Z");
+
+ // Delete existing revisions within the specified time frame
+ var deleteRevisionsOp =
+ new DeleteRevisionsOperation(documentId: "orders/826-A", from: deleteFrom, to: deleteTo);
+
+ var numberOfRevisionsDeleted = await store.Maintenance.SendAsync(deleteRevisionsOp);
+ #endregion
+ }
+
+ using (var store = new DocumentStore())
+ {
+ using (var asyncSession = store.OpenAsyncSession())
+ {
+ #region delete_revisions_4_async
+ // Get the change-vectors for the revisions of the specified document
+ var metadata = await asyncSession.Advanced.Revisions
+ .GetMetadataForAsync("orders/825-A");
+
+ var revisionsChangeVectors = metadata
+ .Select(m => m.GetString(Constants.Documents.Metadata.ChangeVector))
+ .ToList();
+
+ // Delete the revisions by their change-vector
+ var revisionToDelete =
+ new List() { revisionsChangeVectors[0], revisionsChangeVectors[1] };
+
+ var deleteRevisionsOp =
+ new DeleteRevisionsOperation(documentId: "orders/825-A", revisionToDelete);
+
+ var numberOfRevisionsDeleted = await store.Maintenance.SendAsync(deleteRevisionsOp);
+ #endregion
+ }
+ }
+ }
+ }
+
+ public class Syntax
+ {
+ public interface IFoo
+ {
+ /*
+ #region syntax_1
+ Available overloads:
+ ====================
+ public DeleteRevisionsOperation(string documentId,
+ bool removeForceCreatedRevisions = false);
+
+ public DeleteRevisionsOperation(string documentId,
+ DateTime? from, DateTime? to, bool removeForceCreatedRevisions = false);
+
+ public DeleteRevisionsOperation(List documentIds,
+ bool removeForceCreatedRevisions = false);
+
+ public DeleteRevisionsOperation(List documentIds,
+ DateTime? from, DateTime? to, bool removeForceCreatedRevisions = false);
+
+ public DeleteRevisionsOperation(string documentId,
+ List revisionsChangeVectors, bool removeForceCreatedRevisions = false);
+ #endregion
+ */
+ }
+ }
+}