Migration: Client Breaking Changes

The features listed in this page were available in former RavenDB versions and are unavailable in RavenDB 6.x, or their behavior is inconsistent with their behavior in previous versions.

Breaking Changes

  • Include from a Non-tracking session
    A non-tracking session will now throw the below exception if an 'Include' operation is registered in it, to indicate that the operation is forbidden from a non-tracking session and warn about its expected results.
    "This session does not track any entities, because of that registering includes is forbidden to avoid false expectations when later load operations are performed on those and no requests are being sent to the server. Please avoid any 'Include' operations during non-tracking session actions like load or query."

  • 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

  • Indexing
    The default value of the Indexing.OrderByTicksAutomaticallyWhenDatesAreInvolved configuration option is now true

  • Facets
    FacetOptions were removed from RangeFacet

  • Obsolete entities removed
    Many obsolete attributes, properties, and methods were removed from the public API

  • A DisposeCertificate convention has been added to prevent/allow the disposal of DocumentStore.Certificate when the store is disposed of, to help users mitigate the X509Certificate2 leak.
    More info here.

  • Serialization
    Only Public fields are serialized/deserialized when doing a projection. Private fields are not serialized/deserialized.

  • DefaultAsyncHiLoIdGenerator is replaced with AsyncHiLoIdGenerator

    public AsyncHiLoIdGenerator(string tag, DocumentStore store, string dbName, char identityPartsSeparator)

Breaking Changes in a Sharded Database

Unsupported Features

RavenDB 6.0 introduces sharding.
Features that are currently unavailable under a sharded database (but remain available in regular databases) are listed in the sharding unsupported features 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 using a non-sharded type.

The following code, for example, will fail when the database is sharded.

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:

var backupResult = (ShardedBackupResult)result;

Sharding-specific types

  • For Backup: ShardedBackupResult
  • For Restore: ShardedRestoreResult
  • For Smuggler, Import, and Export: ShardedSmugglerResult


  • GET /databases/*/revisions/bin
    Pass start instead of etag
    We now fetch from the last entry backward rather than from a specific etag.

    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>

    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

Do you need any help with Migration?