Article For
4.0 4.1 4.2 5.0 5.1


Conventions give you the ability to customize the Client API behavior. They are accessible from the DocumentStore object:

using (var store = new DocumentStore()
    Conventions =
        // customizations go here




All customizations need to be set before DocumentStore.Initialize() is called.



MaxHttpCacheSize = new Size(256, SizeUnit.Megabytes)

Default size

The default value of this setting is configured as follows:

  • running on 64 bits:

    • if usable memory is lower than or equal to 3GB: 64MB,
    • if usable memory is greater than 3GB and lower than or equal to 6GB: 128MB,
    • if usable memory is greater than 6GB: 512MB,
  • running on 32 bits: 32MB.

The cache is created per database you use.

Disable caching

To disable the caching globally, you can set the MaxHttpCacheSize value to zero:

MaxHttpCacheSize = new Size(0, SizeUnit.Megabytes)




MaxNumberOfRequestsPerSession = 10



UseOptimisticConcurrency = true


It allows you to define the global request timeout value for all RequestExecutors created per database. Default: null.

RequestTimeout = TimeSpan.FromSeconds(90)



DisableTopologyUpdates = false


It determines if C# enum types should be saved as integers or strings and instructs the LINQ provider to query enums as integer values. Default: false.

SaveEnumsAsIntegers = true



UseCompression = true


Changes the way the operation is fetching the operation status when waiting for completion. By default, the value is set to ChangesApi which underneath is using WebSocket protocol when connection is established with the server. On some older systems e.g. Windows 7, the WebSocket protocol might not be available due to the OS and .NET Framework limitations. For that reason, the value can be changed to Polling to bypass this issue.

OperationStatusFetchMode = OperationStatusFetchMode.ChangesApi

Changing fields/properties naming convention



Language Default convention Example
C# PascalCase OrderLines
Java camelCase orderLines
JavaScript camelCase orderLines


Using camelCase in C# client

You have to customize JsonSerializer and PropertyNameConverter.

private string FirstCharToLower(string str) => $"{Char.ToLower(str[0])}{str.Substring(1)}";

Serialization = new NewtonsoftJsonSerializationConventions
    CustomizeJsonSerializer = s => s.ContractResolver = new CamelCasePropertyNamesContractResolver()
PropertyNameConverter = mi => FirstCharToLower(mi.Name)

Changing the Identity Separator

Changes the default separator for automatically generated document IDs. Can be any char except | (pipe). Default: / (forward slash).

This affects these ID generation strategies:

IdentityPartsSeparator = '~'


Changes the location of topology cache files. Setting this value will check directory existance and write permissions. By default it is set to the application base directory (AppContext.BaseDirectory).

TopologyCacheLocation = @"C:\RavenDB\TopologyCache"


Determines whether an Id field is automatically added to dynamic objects. Default: true.

AddIdFieldToDynamicObjects = false


This function can be configured to disable entity tracking for certain entities. Learn more here