You are currently browsing legacy 3.0 version of documentation. Click here to switch to the newest 4.2 version.

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Commands: Indexes: How to change index lock mode?

SetIndexLock method allows you to change index lock mode for a given index.

Syntax

void SetIndexLock(string name, IndexLockMode lockMode);

Parameters
name string name of an index to change lock mode for
lockMode IndexLockMode new index lock mode

Example

store.DatabaseCommands.SetIndexLock("Orders/Totals", IndexLockMode.LockedIgnore);