Filtering values
For JSON source topics, the optional topic value mapping clause can be used to extract part of the source value.
A topic value mapping begins with the keyword as and is followed by a value directive.
This allows you to filter the values presented through reference topics.
Example
A value directive is delimited by angle brackets (<
, >
). It consists of the value keywords and a single JSON pointer parameter.
The JSON pointer selects the part of the source value to copy.
For example, given a source value of:
{
"account" : "1234",
"balance" : { "amount" : 12.57, "currency" : "USD" }
}
and the value mapping clause as <value(/balance)>
, the reference topic value will be:
{
"amount" : 12.57,
"currency" : "USD"
}
Topic value mappings are often used with path value mappings. For example:
map ?accounts// to balances/<scalar(/account)> as <value(/balance)>