see on GitHub

Commands: Transformers: Put

PutTransformer is used to add a transformer to a database.

Syntax

public 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

TransformerDefinition transformerDefinition = new TransformerDefinition();
transformerDefinition.setTransformResults("from order in orders " +
  "select new " +
  "{ " +
  "    order.OrderedAt, " +
  "    order.Status, " +
  "    order.CustomerId, " +
  "    CustomerName = LoadDocument<Customer>(order.CustomerId).Name, " +
  "    LinesCount = order.Lines.Count " +
  "}");

String transformerName = store.getDatabaseCommands().putTransformer("Order/Statistics", transformerDefinition);