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: Indexes: How to check if an index has changed?

IndexHasChanged will let you check if the given index definition differs from the one on a server. This might be useful when you want to check the prior index deployment, if index will be overwritten, and if indexing data will be lost.

Syntax

curl \
	http://{serverName}/databases/{databaseName}/indexes/{indexName}?op=hasChanged \
	-X POST
	-d @indexDefinition.txt

Request

Payload
IndexDefinition

Response

Status code Description
200 OK
Return Value Description
Name index name
Changed true/false

Example I

curl -X POST "http://localhost:8080/databases/NorthWind/indexes/Orders/Totals?op=hasChanged" 
	-d @indexDefinition.txt
< HTTP/1.1 200 OK
{"Name":"Orders/Totals","Changed":false}