see on GitHub

Commands : Transformers : Put

PutTransformer is used to add a transformer to a database.

Syntax

string PutTransformer(string name, TransformerDefinition transformerDef);

Parameters
name string name of a transformer
transformerDef TransformerDefinition definition of a transformer
Return Value
string Transformer name.

Example

string transformerName = store
	.DatabaseCommands
	.PutTransformer(
		"Order/Statistics",
		new TransformerDefinition
		{
			TransformResults = @"from order in results
								select new
								{
									order.OrderedAt,
									order.Status,
									order.CustomerId,
									CustomerName = LoadDocument(order.CustomerId).Name,
									LinesCount = order.Lines.Count
								}",
                        Name = "Order/Statistics"
		});