Language
C# Java
Article For
3.5

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, ... ]