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

We can help you with migration to the latest RavenDB

Contact Us Now
see on GitHub

Commands: How to compact database?

To compact a database, please use compact endpoint.

Syntax

curl \
	http://{serverName}/admin/compact?database={databaseName} \
	-X POST

Request

Query parameter Required Description
databaseName Yes Name of a database to compact

Response

Status code Description
200 OK
Return Value Description
OperationId Operation id

Example

curl -X POST "http://localhost:8080/admin/compact?database=NorthWind"
< HTTP/1.1 200 OK
{"OperationId":1}

Remarks

Compacting operation is executed asynchronously and during this operation the database will be offline.