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

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Commands: StartCompact

StartCompact initializes the compaction of the indicated file system. This operation makes the file system offline for the time of compaction.


Task<long> StartCompact(string filesystemName);
filesystemName string The name of a file system to compact

Return Value
Task<long> A task that represents the asynchronous restore operation. The task result is the operation identifier.


long compactOperationId = await store.AsyncFilesCommands.Admin

If you need to wait until the operation finishes, you will have to initialize DocumentStore associated with <system> database and wait for the operation completion:

using (var sysDbStore = new DocumentStore
	Url = "http://localhost:8080/"
	await new Operation((AsyncServerClient)sysDbStore.AsyncDatabaseCommands, compactOperationId)