Skip to main content

Migration: Client Breaking Changes

The features listed on 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 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.
  • 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.

  • Certificate disposal
    The 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.

  • 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

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 to a non-sharded type.

For example, the following code 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;
  • 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.

    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>.

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 breaking changes