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 the following exception if an 'Include' operation is used in it,
to indicate that the operation is forbidden in a non-tracking session and to 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 theint
type in former RavenDB versions now uselong
, e.g. QueryStatistics.TotalResults. -
Indexing
The default value of the Indexing.OrderByTicksAutomaticallyWhenDatesAreInvolved configuration option is nowtrue
. -
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 ofDocumentStore.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 withAsyncHiLoIdGenerator
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;
Sharding-specific types
- For Backup:
ShardedBackupResult
- For Restore:
ShardedRestoreResult
- For Smuggler, Import, and Export:
ShardedSmugglerResult
Endpoints:
-
GET /databases/*/revisions/bin
Passstart
instead ofetag
.
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
TheTerms
field of the returned results is nowList<String>
instead ofHashSet<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 frometag
tostart
.
Additional breaking changes
- Failed to project when having a backing private field
- Unexpected results on projection query on a static index with a dictionary
- Check that query relays on PropertyNameConverter to get property name
- Overflow of ReduceAttempts
- Review all Obsolete() attributes in 6.0
- Inconsistency in
BlittableJsonTraverserHelper.TryRead
when trying to filter docs with nested non-existing field - Removed non-typed inheritance from typed incremental time series client API
CollectionStatistics
properties are nowlong
- Removed private fields from the projection
- DocumentConventions.UseCompression is not respected by BlittableJsonContent
- LINQ projection convention is not applied inside javascript projection when querying static index
- RavenBooleanQuery - merging two RavenBooleanQuery requires an additional boosting check
- Index deletion is prevented when index lock mode is locked
- Wrong query result with CamelCasePropertyNamesContractResolver
- Compare Exchange includes do not override compare exchange values that are already tracked in the session