Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

RavenDB 6.1 breaking changes #1890

Merged
merged 11 commits into from
Aug 27, 2024
Merged
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
namespace RavenCodeSamples.ClientApi
{
using System;
using Raven.Abstractions.Data;
using Raven.Client.Changes;

public class ChangesApi : CodeSampleBase
{
public ChangesApi()
{
/*
using (var store = NewDocumentStore())
{

#region getting_database_changes_instance

IDatabaseChanges changes = store.Changes("DatabaseName");
Expand Down Expand Up @@ -76,6 +76,7 @@ public ChangesApi()
});
#endregion
}
*/
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public CountersExamples()
},
new CounterOperation
{
// No delta specified, value will stay the same
// No Delta specified, value will remain unchanged

Type = CounterOperationType.Increment,
CounterName = "dislikes"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,125 @@
# Changes API: How to Subscribe to Operation Changes

The following methods allow you to subscribe to operation changes:

- [ForOperationId](../../client-api/changes/how-to-subscribe-to-operation-changes#foroperationid)
- [ForAllOperations](../../client-api/changes/how-to-subscribe-to-operation-changes#foralloperations)

{PANEL:ForOperationId}

Operation changes for one operation can be observed using the `ForOperationId` method.

{NOTE: }
Please note that from RavenDB 6.1 on, operation changes can be tracked only on a **specific node**.
The purpose of this change is to improve results consistency, as an operation may behave very differently
on different nodes and cross-cluster tracking of an operation may become confusing and ineffective if
the operation fails over from one node to another.
Tracking operations will therefore be possible only if the `Changes` API was
[opened](../../client-api/changes/what-is-changes-api#accessing-changes-api) using a method that limits
tracking to a single node: `store.Changes(dbName, nodeTag)`
{NOTE/}

### Syntax

{CODE operation_changes_1@ClientApi\Changes\HowToSubscribeToOperationChanges.cs /}

| Parameters | | |
| ------------- | ------------- | ----- |
| **operationId** | long | ID of an operation for which notifications will be processed. |

| Return value | |
| ------------- | ----- |
| IChangesObservable<[OperationStatusChange](../../client-api/changes/how-to-subscribe-to-operation-changes#operationchange)> | Observable that allows you to add subscriptions to notifications for an operation with a given ID. |

### Example

{CODE operation_changes_2@ClientApi\Changes\HowToSubscribeToOperationChanges.cs /}

{PANEL/}

{PANEL:ForAllOperations}

Operations changes for all Operations can be observed using the `ForAllOperations` method.

{NOTE: }
Please note that from RavenDB 6.1 on, operation changes can be tracked only on a **specific node**.
The purpose of this change is to improve results consistency, as an operation may behave very differently
on different nodes and cross-cluster tracking of an operation may become confusing and ineffective if
the operation fails over from one node to another.
Tracking operations will therefore be possible only if the `Changes` API was
[opened](../../client-api/changes/what-is-changes-api#accessing-changes-api) using a method that limits
tracking to a single node: `store.Changes(dbName, nodeTag)`
{NOTE/}

| Return Value | |
| ------------- | ----- |
| IChangesObservable<[OperationStatusChange](../../client-api/changes/how-to-subscribe-to-operation-changes#operationchange)> | Observable that allows to add subscriptions to notifications for all operations. |

### Syntax

{CODE operation_changes_3@ClientApi\Changes\HowToSubscribeToOperationChanges.cs /}

### Example

{CODE operation_changes_4@ClientApi\Changes\HowToSubscribeToOperationChanges.cs /}

{PANEL/}

{PANEL:OperationChange}

### Properties

| Name | Type | Description |
| ------------- | ------------- | ----- |
| **State** | [OperationState](../../client-api/changes/how-to-subscribe-to-operation-changes#operationstate) | Operation state |
| **OperationId** | long | Operation ID |

{PANEL/}

{PANEL:OperationState}

### Members

| Name | Type | Description |
| ------------- | ------------- | ----- |
| **Result** | [IOperationResult](../../client-api/changes/how-to-subscribe-to-operation-changes#operationresult) | Operation result |
| **Progress** | IOperationProgress| Instance of IOperationProgress (json representation of the progress) |
| **Status** | [OperationStatus](../../client-api/changes/how-to-subscribe-to-operation-changes#operationstatus) | Operation status |
{PANEL/}

{PANEL:OperationResult}

### Members

| Name | Type | Description |
| ------------- | ------------- | ----- |
| **Message** | string | Operation message |
| **ShouldPersist** | bool | determine whether or not the result should be saved in the storage |
{PANEL/}

{PANEL:OperationStatus}

# OperationStatus (enum)

| Name | Description |
| ---- | ----- |
| **InProgress** | `Indicates that the operation made progress` |
| **Completed** | `Indicates that the operation has completed` |
| **Faulted** | `Indicates that the operation is faulted` |
| **Canceled** | `Indicates that the operation has been Canceled` |
{PANEL/}

## Remarks

{WARNING: }
To get more method overloads, especially ones supporting **delegates**, please add the
[System.Reactive.Core](https://www.nuget.org/packages/System.Reactive.Core/) package to your project.
{WARNING/}

## Related Articles

### Changes API

- [What is Changes API](../../client-api/changes/what-is-changes-api)
- [How to Subscribe to Document Changes](../../client-api/changes/what-is-changes-api)
- [How to Subscribe to Index Changes](../../client-api/changes/how-to-subscribe-to-index-changes)
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Changes API: How to Subscribe to Operation Changes

The following methods allow you to subscribe to operation changes:

- [forOperationId](../../client-api/changes/how-to-subscribe-to-operation-changes#foroperation)
- [forAllOperations](../../client-api/changes/how-to-subscribe-to-operation-changes#foralloperations)

{PANEL:forOperation}

Operation changes for one operation can be observed using the `forOperationId` method.

### Syntax

{CODE:java operation_changes_1@ClientApi\Changes\HowToSubscribeToOperationChanges.java /}

| Parameters | | |
| ------------- | ------------- | ----- |
| **operationId** | long | ID of an operation for which notifications will be processed. |

| Return value | |
| ------------- | ----- |
| IChangesObservable<[OperationStatusChange](../../client-api/changes/how-to-subscribe-to-operation-changes#operationchange)> | Observable that allows you to add subscriptions to notifications for an operation with a given ID. |

### Example

{CODE:java operation_changes_2@ClientApi\Changes\HowToSubscribeToOperationChanges.java /}

{PANEL/}

{PANEL:forAllOperations}

Operations changes for all Operations can be observed using the `forAllOperations` method.

| Return Value | |
| ------------- | ----- |
| IChangesObservable<[OperationStatusChange](../../client-api/changes/how-to-subscribe-to-operation-changes#operationchange)> | Observable that allows to add subscriptions to notifications for all operations. |

### Syntax

{CODE:java operation_changes_3@ClientApi\Changes\HowToSubscribeToOperationChanges.java /}

### Example

{CODE:java operation_changes_4@ClientApi\Changes\HowToSubscribeToOperationChanges.java /}

{PANEL/}

{PANEL:OperationChange}

### Properties

| Name | Type | Description |
| ------------- | ------------- | ----- |
| **State** | ObjectNode | Operation state |
| **OperationId** | long | Operation ID |

{PANEL/}


## Related Articles

### Changes API

- [What is Changes API](../../client-api/changes/what-is-changes-api)
- [How to Subscribe to Document Changes](../../client-api/changes/what-is-changes-api)
- [How to Subscribe to Index Changes](../../client-api/changes/how-to-subscribe-to-index-changes)
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
# Changes API: How to Subscribe to Operation Changes

The following methods allow you to subscribe to operation changes:

- [forOperationId()](../../client-api/changes/how-to-subscribe-to-operation-changes#foroperation)
- [forAllOperations()](../../client-api/changes/how-to-subscribe-to-operation-changes#foralloperations)

{PANEL:forOperation}

Operation changes for one operation can be observed using the `forOperationId()` method.

### Syntax

{CODE:nodejs operation_changes_1@client-api\changes\howToSubscribeToOperationChanges.js /}

| Parameters | | |
| ------------- | ------------- | ----- |
| **operationId** | number | ID of an operation for which notifications will be processed. |

| Return value | |
| ------------- | ----- |
| IChangesObservable<[OperationStatusChange](../../client-api/changes/how-to-subscribe-to-operation-changes#operationchange)> | Observable that allows you to add subscriptions to notifications for an operation with a given ID. |

### Example

{CODE:nodejs operation_changes_2@client-api\changes\howToSubscribeToOperationChanges.js /}

{PANEL/}

{PANEL:forAllOperations}

Operations changes for all Operations can be observed using the `forAllOperations()` method.

| Return Value | |
| ------------- | ----- |
| IChangesObservable<[OperationStatusChange](../../client-api/changes/how-to-subscribe-to-operation-changes#operationchange)> | Observable that allows to add subscriptions to notifications for all operations. |

### Syntax

{CODE:nodejs operation_changes_3@client-api\changes\howToSubscribeToOperationChanges.js /}

### Example

{CODE:nodejs operation_changes_4@client-api\changes\howToSubscribeToOperationChanges.js /}

{PANEL/}

{PANEL:OperationChange}

### Properties

| Name | Type | Description |
| ------------- | ------------- | ----- |
| **state** | object | Operation state |
| **operationId** | number | Operation ID |

{PANEL/}


## Related Articles

### Changes API

- [What is Changes API](../../client-api/changes/what-is-changes-api)
- [How to Subscribe to Document Changes](../../client-api/changes/what-is-changes-api)
- [How to Subscribe to Index Changes](../../client-api/changes/how-to-subscribe-to-index-changes)
Loading
Loading