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: Transformers: Get

There are few methods that allow you to retrieve transformers from a database:
- GetTransformer
- GetTransformers

GetTransformer

GetTransformer is used to retrieve a single transformer

Syntax

curl \
	http://{serverName}/databases/{databaseName}/transformers/{transformerName} \
	-X GET

Request

Query parameter Required Description
transformerName Yes transformer name

Response

Status code Description
200 OK
Return Value Description
payload TransformerDefinition

Example

curl -X GET "http://localhost:8080/databases/NorthWind/transformers/Order/Statistics"
< HTTP/1.1 200 OK
{
	"Transformer":
	{
		"TransformResults":"from order in results select new { 
		    order.OrderedAt,     
			order.Status,     
			order.CustomerId,     
			CustomerName = LoadDocument(order.CustomerId).Name,     
			LinesCount = order.Lines.Count }",
		"TransfomerId":2,
		"Name":"Order/Statistics"
	}
}

GetTransformers

GetTransformers is used to retrieve a multiple transformers

Syntax

curl \
	http://{serverName}/databases/{databaseName}/transformers? \
		&start={start} \
		&pageSize={pageSize} \
	-X GET

Request

Query parameter Required Description
start No number of documents that should be skipped
pageSize No maximum number of transformers that will be retrieved

Response

Status code Description
200 OK
Return Value Description
payload array of TransformerDefinition

Example

curl -X GET "http://localhost:8080/databases/NorthWind/transformers?start=0&pageSize=10"
< HTTP/1.1 200 OK
[ transformerDefinition, transformerDefinition, ... ]