---
title: "Migration: previous-versions breaking changes"
description: "Review breaking changes in previous RavenDB client SDK versions to plan your upgrade path and update affected application code."
url: "https://docs.ravendb.net/7.2/migration/client-api/previous-versions-client-breaking-changes"
version: "7.2"
---

# Migration: previous-versions breaking changes

> RavenDB publishes an official agent skill for coding assistants at https://docs.ravendb.net/skills/ravendb/SKILL.md (also installable with `npx skills add ravendb/skills`). The skill describes itself as: "Read this before writing any RavenDB query, client call or /databases/ request. Covers server setup, document modelling, the Node.js, .NET and Python clients, RQL, indexes, vector search and AI agents. Code written from recall tends to run and return the wrong rows, because RQL resembles SQL and the clients take field names as plain strings."

## Migration: previous-versions breaking changes

> **Note**
>
> This page lists client breaking changes introduced in RavenDB versions earlier than `7.2`.  
> Each breaking change indicates a behavior change or a function that is no longer available in the specified version.
>
> - In this article:
>   - [RavenDB 7.0 client breaking changes](#ravendb-7-0-client-breaking-changes)
>     - [Subscription creation overload modification](#subscription-creation-overload-modification)
>     - [HTTP-Compression algorithm is now `Zstd` by default](#http-compression-algorithm-is-now-zstd-by-default)
>     - [Bulk-insert Compression is now Enabled by default](#bulk-insert-compression-is-now-enabled-by-default)
>     - [Removed irrelevant `SingleNodeBatchCommand` parameters](#removed-irrelevant-singlenodebatchcommand-parameters)
>     - [Removed obsolete methods](#removed-obsolete-methods)
>     - [`FromEtl` is now internal](#frometl-is-now-internal)
>     - [Deploying multiple indexes is now atomic](#deploying-multiple-indexes-is-now-atomic)
>   - [RavenDB 6.2 client breaking changes](#ravendb-6-2-client-breaking-changes)
>     - [`CounterBatchOperation` default increment Delta is 1](#counterbatchoperation-default-increment-delta-is-1)
>     - [CmpXchg item can only be created with an index of 0](#cmpxchg-item-can-only-be-created-with-an-index-of-0)
>     - [Dynamic Linq query cannot apply `.Any` with logical AND (`&&`)](#dynamic-linq-query-cannot-apply-any-with-logical-and-)
>     - [`LoadDocument` must be provided with a collection name String](#loaddocument-must-be-provided-with-a-collection-name-string)
>     - [Tracking operations using the Changes API now requires Node Tag](#tracking-operations-using-the-changes-api-now-requires-node-tag)
>     - [Consistency in `null` handling](#consistency-in-null-handling)
>   - [RavenDB 6.0 client breaking changes](#ravendb-6-0-client-breaking-changes)
>     - [6.0 Breaking changes](#60-breaking-changes)
>     - [6.0 Breaking changes in a sharded database](#60-breaking-changes-in-a-sharded-database)
>     - [Additional 6.0 breaking changes](#additional-60-breaking-changes)

## RavenDB 7.0 client breaking changes {#ravendb-7-0-client-breaking-changes}

### Subscription creation overload modification

- In RavenDB versions earlier than **7.0**, the `Create<T>` method overload that accepted a predicate also allowed specifying a query through `SubscriptionCreationOptions`,
  which could cause errors and confusion.
- To eliminate this ambiguity, starting from **7.0**, the `Create<T>` overload for predicate-based subscriptions now accepts `PredicateSubscriptionCreationOptions`,
  which no longer includes a `Query` property.
- Refer to the [Subscription creation API overview](https://docs.ravendb.net/7.2/data-subscriptions/creating-subscription/creating-subscription_api.md) for the complete list of available `Create` method overloads.

#### 7.0\_and\_on

```csharp
// The create overload using a predicate:
// ======================================
string Create<T>(Expression<Func<T, bool>> predicate = null,
    PredicateSubscriptionCreationOptions options = null,
    string database = null);

Task<string> CreateAsync<T>(Expression<Func<T, bool>> predicate = null,
    PredicateSubscriptionCreationOptions options = null,
    string database = null,
    CancellationToken token = default);

// The options class:
// ==================
public sealed class PredicateSubscriptionCreationOptions
{
    public string Name { get; set; }
    public string ChangeVector { get; set; }
    public string MentorNode { get; set; }
    public bool Disabled { get; set; }
    public bool PinToMentorNode { get; set; }
    public ArchivedDataProcessingBehavior? ArchivedDataProcessingBehavior { get; set; }
}
```

#### up\_to\_6.2

```csharp
// The create overload using a predicate:
// ======================================
string Create<T>(Expression<Func<T, bool>> predicate = null,
    SubscriptionCreationOptions options = null,
    string database = null);

Task<string> CreateAsync<T>(Expression<Func<T, bool>> predicate = null,
    SubscriptionCreationOptions options = null,
    string database = null,
    CancellationToken token = default);

// The options class:
// ==================
public class SubscriptionCreationOptions
{
    public string Name { get; set; }
    public string Query { get; set; }
    public string ChangeVector { get; set; }
    public string MentorNode { get; set; }
    public virtual bool Disabled { get; set; }
    public virtual bool PinToMentorNode { get; set; }
    public ArchivedDataProcessingBehavior? ArchivedDataProcessingBehavior { get; set; }
}
```

### HTTP-Compression algorithm is now `Zstd` by default

From RavenDB `7.0` on, the default HTTP compression algorithm is `Zstd` (instead of `Gzip`, used in earlier versions).

> **Note:** To switch the HTTP-compression algorithm: {#to-switch-the-http-compression-algorithm}
>
> Clients can switch to a different HTTP-Compression algorithm using `DocumentStore`'s
> [DocumentConventions.HttpCompressionAlgorithm](https://docs.ravendb.net/7.2/client-api/configuration/conventions.md#httpcompressionalgorithm) convention.
>
> ```csharp
> var DocumentConventions = new DocumentConventions
> {
>     // Switch HTTP compression algorithm
>     HttpCompressionAlgorithm = HttpCompressionAlgorithm.Gzip
> };
> ```

> **Warning**
>
> If you migrate from an earlier RavenDB version to version `7.0` or higher,  
> please note the [potential significance of this change](https://docs.ravendb.net/7.2/migration/client-api/client-migration.md#client-migration-to-ravendb-7x).

### Bulk-insert Compression is now Enabled by default

Compression is now [Enabled by default for bulk-insert operations](https://docs.ravendb.net/7.2/client-api/bulk-insert/how-to-work-with-bulk-insert-operation.md#section).

```csharp
CompressionLevel DefaultCompressionLevel = CompressionLevel.Fastest;
```

> **Note:** To switch the bulk-insert state: {#to-switch-the-bulk-insert-state}
>
> Clients can switch to a different bulk-insert compression state using `Store`'s
> [BulkInsertOptions.CompressionLevel](https://docs.ravendb.net/7.2/client-api/bulk-insert/how-to-work-with-bulk-insert-operation.md#bulkinsertoptions) option.
>
> ```csharp
> using (var bulk = store.BulkInsert(new BulkInsertOptions
> {
>     // Disable bulk-insert compression
>     CompressionLevel = CompressionLevel.NoCompression
> }));
> ```

### Removed irrelevant `SingleNodeBatchCommand` parameters

We removed from [SingleNodeBatchCommand](https://docs.ravendb.net/7.2/client-api/commands/batches/how-to-send-multiple-commands-using-a-batch.md)'s
definition the parameters that are mainly used internally and kept only those relevant to the user.

> **Note:** \`SingleNodeBatchCommand\` signature: {#singlenodebatchcommand-signature}
>
> #### 7.0\_and\_on
>
> ```text
> public SingleNodeBatchCommand
>     (DocumentConventions conventions, 
>      IList<ICommandData> commands, 
>      BatchOptions options = null)
> ```
>
> #### up\_to\_6.2
>
> ```text
> public SingleNodeBatchCommand
>     (DocumentConventions conventions, 
>      JsonOperationContext context, 
>      IList<ICommandData> commands, 
>      BatchOptions options = null, 
>      TransactionMode mode = TransactionMode.SingleNode)
> ```

### Removed obsolete methods

The following methods are no longer used and have been removed from RavenDB `7.0`.

- `NextPageStart`
  ```csharp
  public int NextPageStart { get; set; }
  ```

- `GenerateEntityIdOnTheClient`
  ```csharp
  public GenerateEntityIdOnTheClient(DocumentConventions conventions,
                                    Func<object, string> generateId)
  ```

- `InMemoryDocumentSessionOperations.GenerateId`
  ```csharp
  protected override string GenerateId(object entity)
  ```

- `InMemoryDocumentSessionOperations.GetOrGenerateDocumentIdAsync`
  ```csharp
  protected async Task<string> GetOrGenerateDocumentIdAsync(object entity)
  ```

### `FromEtl` is now internal

The `CounterBatch` class `FromEtl` property is now **internal**.  
`FromEtl` is used internally to get or set a value indicating whether a counters batch originated from an ETL process.

### Deploying multiple indexes is now atomic

This change applies to the **.NET client** only.

In RavenDB versions earlier than `7.0`, [IndexCreation.CreateIndexes](https://docs.ravendb.net/7.2/indexes/creating-and-deploying.md#deploy-multiple-indexes)
sent all index definitions in a single request, and if that request failed it retried the deployment
index-by-index. Indexes that were valid were therefore still created, and the indexes that failed were
reported together in an `AggregateException`.

From `7.0` on, `IndexCreation.CreateIndexes` delegates to
[DocumentStore.ExecuteIndexes](https://docs.ravendb.net/7.2/indexes/creating-and-deploying.md#deploy-multiple-indexes) and the
two methods behave identically. The batch is now atomic:

- If any index in the batch fails to compile, the entire batch fails and **none** of the indexes
  in it are created.
- The failure is reported as an `IndexCompilationException` naming the index that caused it,
  instead of an `AggregateException`.

> **Note**
>
> If your deployment flow relied on the valid indexes being created despite one of them failing,
> deploy the indexes in separate calls, or call `Execute` on each index individually.

> **Info**
>
> Deploying an empty list of indexes is a no-op from `7.0` on: no request is sent to the server
> and no exception is thrown.

## RavenDB 6.2 client breaking changes {#ravendb-6-2-client-breaking-changes}

### `CounterBatchOperation` default increment Delta is 1

When [CounterBatchOperation](https://docs.ravendb.net/7.2/client-api/operations/counters/counter-batch.md) is
called to `Increment` a batch of counters, and no `Delta` is specified to indicate
what value should be added to the counters, the operation will increment the counters
by a default `Delta`.

- Previous RavenDB versions set a default `Delta` of `0`, leaving the counters value unchanged.
- Starting RavenDB `6.2` the default `Delta` is `1` to make it consistent with the rest of the API.

```csharp
var operationResult = store.Operations.Send(new CounterBatchOperation(new CounterBatch
{
    Documents = new List<DocumentCountersOperation>
    {
        new DocumentCountersOperation
        {
            DocumentId = "users/1",
            Operations = new List<CounterOperation>
            {
                new CounterOperation
                {
                    Type = CounterOperationType.Increment,
                    CounterName = "likes",
                    Delta = 5
                },
                new CounterOperation
                {
                    // No delta specified, value will be incremented by 1
                    Type = CounterOperationType.Increment,
                    CounterName = "dislikes"
                }
            }
        }
    }
}));
```

### CmpXchg item can only be created with an index of 0

Creating a [compare exchange item](https://docs.ravendb.net/7.2/compare-exchange/create-cmpxchg-items.md#create-item-using-a-store-operation)
using `PutCompareExchangeValueOperation` is now possible only if the `index` parameter
passed to the method is `0`.

```csharp
// Creating the item will fail because the index is not 0
CompareExchangeResult<string> compareExchangeResult
    = store.Operations.Send(
        new PutCompareExchangeValueOperation<string>("key", "value", 123));

// Creating the item will succeed because the index is 0
compareExchangeResult = store.Operations.Send(
        new PutCompareExchangeValueOperation<string>("key", "value", 0));
```

### Dynamic Linq query cannot apply `.Any` with logical AND (`&&`)

RavenDB does not support dynamic Linq queries (i.e. queries executed over auto indexes)
when they attempt to apply multiple conditions using the `.Any` method with a logical AND (`&&`).  
The below query, for example, is *not supported*.

```sql
using (var store = new DocumentStore())
{
    var guestsCarryingSmallSilverSuitcases = session.Query<Guest>()
        // Applying .Any with && is not supported
        .Where(x => x.Suitcase.Any(p => p.Size == "Small" && p.Color == "Silver"))
        .ToList();
}
```

> **Info**
>
> While *auto* indexes do not currently support this type of query, *static* indexes do.  
> You can define a **static fanout index** that creates separate index entries for different
> document sub-objects, and run your query over these entries.  
> Read about the indexing of nested data [here](https://docs.ravendb.net/7.2/indexes/indexing-nested-data.md),  
> and find explanations and samples for fanout indexes [here](https://docs.ravendb.net/7.2/indexes/indexing-nested-data.md#fanout-index---multiple-index-entries-per-document).

### `LoadDocument` must be provided with a collection name String

When [LoadDocument](https://docs.ravendb.net/7.2/indexes/indexing-related-documents.md) is used in an index query
to load related documents, it is passed a **document ID** and a **collection name**.

The collection name **must** be passed to `LoadDocument` as a regular string; attempting
to pass it a dynamic expression instead of a string will fail with an `IndexCompilationException`
exception and this message: `LoadDocument method has to be called with constant value as collection name`

The following query, for example, will fail because it attempts to build the collection name dynamically.

```sql
from doc in docs.Orders
select new {
    // This attempt to construct a collection name will fail with an exception
    CompanyName = LoadDocument(doc.Company, doc.Company.Split('/')[0]).Name
}
```

> **Note**
>
> Note that the validation of the collection name string will be forced only during
> the creation of a **new** index.
> An attempt to update an existing index with a collection name expression rather
> than a string will fail but the failure will remain unnoticed and an exception
> will not be thrown.

### Tracking operations using the Changes API now requires Node Tag

[Tracking operations using the changes API](https://docs.ravendb.net/7.2/client-api/changes/how-to-subscribe-to-operation-changes.md)
now requires that you pass the changes API both a database name **and** a node tag for the specific node that
runs the operation/s you want to track, to ensure that the API consistently tracks this selected node.

The changes API can be opened using two `Changes` overloads. The first passes the API only the database name
and is capable of tracking all entities besides operations. Attempting to track operations after opening the
API this way will fail with an `ArgumentException` exception and the following message:  
`"Changes API must be provided a node tag in order to track node-specific operations."`

To track operations, open the API using this overload:

```csharp
ISingleNodeDatabaseChanges Changes(string database, string nodeTag);
```

Then, you can use `ForOperationId` or `ForAllOperations` to track a certain operation or all
the operations executed by the selected node. Here's a simple usage example:

```csharp
IDisposable subscription = store
    .Changes(database, nodeTag)
    .ForOperationId(operationId)
    .Subscribe(
        change =>
        {
            switch (change.State.Status)
            {
                case OperationStatus.InProgress:
                    //Do Something
                    break;
                case OperationStatus.Completed:
                    //Do Something
                    break;
                case OperationStatus.Faulted:
                    //Do Something
                    break;
                case OperationStatus.Canceled:
                    //Do Something
                    break;
                default:
                    throw new ArgumentOutOfRangeException();
            }
        });
```

### Consistency in `null` handling

`IAsyncDocumentSession.LoadAsync` and `IAsyncLazySessionsOperations.LoadAsync` now
do not throw an exception when they are passed `null`, becoming consistent with the
behavior of the majority of RavenDB's methods.

```csharp
// This will work without issues
IAsyncDocumentSession.LoadAsync(null)
```

## RavenDB 6.0 client breaking changes {#ravendb-6-0-client-breaking-changes}

### 6.0 Breaking changes

- **Include from a non-tracking session**
  - A non-tracking session will now throw an exception if an `Include` operation is used in it.
  - Like other entities in a `NoTracking` session,
    included items are not tracked and will not prevent additional server requests during subsequent *Load* operations for the same data.
    To avoid confusion, *Include* operations are disallowed during non-tracking session actions such as *Load* or *Query*.
  - Learn more in [Using 'Include' in a NoTracking session will throw](https://docs.ravendb.net/7.2/client-api/session/configuration/how-to-disable-tracking.md#using-).

- **Type changes**  
  Many methods related to paging information (Skip, Take, PageSize, TotalResults, etc.) that used the `int` type in former RavenDB versions now use `long`,
  e.g. [QueryStatistics.TotalResults](https://docs.ravendb.net/7.2/client-api/session/querying/how-to-get-query-statistics.md#syntax).

- **Indexing**  
  The default value of the
  [Indexing.OrderByTicksAutomaticallyWhenDatesAreInvolved](https://docs.ravendb.net/7.2/server/configuration/indexing-configuration.md#indexingorderbyticksautomaticallywhendatesareinvolved)
  configuration option is now `true`.

- **Facets**  
  `FacetOptions` were removed from [RangeFacet](https://docs.ravendb.net/7.2/indexes/querying/faceted-search.md#syntax).

- **Obsolete entities removed**  
  Many obsolete attributes, properties, and methods were removed from the public API.

- **Certificate disposal**  
  The [DisposeCertificate](https://docs.ravendb.net/7.2/client-api/configuration/conventions.md#disposecertificate) convention has been introduced
  to prevent or allow the disposal of `DocumentStore.Certificate` when the store is disposed,
  helping users mitigate the [X509Certificate2 leak](https://snede.net/the-most-dangerous-constructor-in-net/).

- **Serialization**  
  Only *Public* fields are serialized/deserialized when projecting query results.  
  *Private* fields are **not** serialized/deserialized.

- **HiLo ID generator**  
  `DefaultAsyncHiLoIdGenerator` is replaced with `AsyncHiLoIdGenerator`
  ```csharp
  public AsyncHiLoIdGenerator(string tag, DocumentStore store, string dbName, char identityPartsSeparator)
  ```

### 6.0 Breaking changes in a sharded database

##### Unsupported features:

RavenDB 6.0 introduces [sharding](https://docs.ravendb.net/7.2/sharding/overview.md).  
Features that are currently unavailable under a sharded database (but remain available in regular databases)
are listed in the sharding [unsupported features](https://docs.ravendb.net/7.2/sharding/unsupported.md) page.  
Attempting to use these features when the database is sharded will normally throw a `NotSupportedInShardingException` exception.

##### Casting smuggler results:

The result sets returned by Smuggler and features that use it (import, export, Backup
and Restore) are sharding-specific and should not be cast to a non-sharded type.

For example, the following code **will fail** when the database is sharded.

```csharp
var operation = await store.Maintenance.SendAsync(new BackupOperation(config));
var result = await operation.WaitForCompletionAsync(TimeSpan.FromSeconds(60));

// This will fail with a sharded database
var backupResult = (BackupResult)result;
```

For the code to succeed, replace the last line with:

```csharp
{`var backupResult = (ShardedBackupResult)result;
```

> **Info:** Sharding-specific types {#sharding-specific-types}
>
> - For Backup: `ShardedBackupResult`
> - For Restore: `ShardedRestoreResult`
> - For Smuggler, Import, and Export: `ShardedSmugglerResult`

##### Endpoints:

- `GET /databases/*/revisions/bin`  
  Pass `start` instead of `etag`.  
  We now fetch from the last entry backward rather than from a specific etag.
  > **Info**
  >
  > `GetRevisionsBinEntryCommand`  
  > Previous definition: `GetRevisionsBinEntryCommand(long etag, int? pageSize)`  
  > Current definition: `GetRevisionsBinEntryCommand(int start, int? pageSize)`

- `GET /databases/*/indexes/terms`  
  The `Terms` field of the returned results is now `List<String>` instead of `HashSet<String>`.
  ```csharp
  public class TermsQueryResult
  {
    public List<string> Terms { get; set; }
    public long ResultEtag { get; set; }
    public string IndexName { get; set; }
  }
  ```

- `GET database/*/debug/documents/get-revisions`  
  Operation parameter changed from `etag` to `start`.

### Additional 6.0 breaking changes

- [Failed to project when having a backing private field](https://issues.hibernatingrhinos.com/issue/RavenDB-18657)
- [Unexpected results on projection query on a static index with a dictionary](https://issues.hibernatingrhinos.com/issue/RavenDB-19560)
- [Check that query relays on PropertyNameConverter to get property name](https://issues.hibernatingrhinos.com/issue/RavenDB-19209)
- [Overflow of ReduceAttempts](https://issues.hibernatingrhinos.com/issue/RavenDB-19729)
- [Review all Obsolete() attributes in 6.0](https://issues.hibernatingrhinos.com/issue/RavenDB-19989)
- [Inconsistency in `BlittableJsonTraverserHelper.TryRead` when trying to filter docs with nested non-existing field](https://issues.hibernatingrhinos.com/issue/RavenDB-19856)
- [Removed non-typed inheritance from typed incremental time series client API](https://issues.hibernatingrhinos.com/issue/RavenDB-19511)
- [`CollectionStatistics` properties are now `long`](https://issues.hibernatingrhinos.com/issue/RavenDB-19602)
- [Removed private fields from the projection](https://issues.hibernatingrhinos.com/issue/RavenDB-18865)
- [DocumentConventions.UseCompression is not respected by BlittableJsonContent](https://issues.hibernatingrhinos.com/issue/RavenDB-20057)
- [LINQ projection convention is not applied inside javascript projection when querying static index](https://issues.hibernatingrhinos.com/issue/RavenDB-17708)
- [RavenBooleanQuery - merging two RavenBooleanQuery requires an additional boosting check](https://issues.hibernatingrhinos.com/issue/RavenDB-20449)
- [Index deletion is prevented when index lock mode is locked](https://issues.hibernatingrhinos.com/issue/RavenDB-19239)
- [Wrong query result with CamelCasePropertyNamesContractResolver](https://issues.hibernatingrhinos.com/issue/RavenDB-20634)
- [Compare Exchange includes do not override compare exchange values that are already tracked in the session](https://issues.hibernatingrhinos.com/issue/RavenDB-21069)
