Alternate Key Mapping
This section explains about the Alternate Keys that are used to fetch data in addition to the existing key fields of any database. The data model of alternate key across all database is shown below.
|
Column Name |
Type |
Description |
|---|---|---|
|
alternateKey |
String |
it is the value of the field which is a alternate key |
|
entityId |
String |
the value of primary key field will be stored here, it acts as a foreign key |
|
alternateName |
String |
it is the label name of alternate key field |
The format of the alternate key specification is SchemaName_EntityNameAlt.json (for example, PAYMENT_ORDEREvent_PaymentOrderAlt.json).
A sample Input Payload is given below.
{
"application": "PAYMENT.ORDER",
"dataEventSize": 1,
"amount": 100,
"dataEventIndex": 0,
"entityName": "USD"
}
[
{
"operation": "shift",
"spec": {
"application": "alternateKey",
"dataEventSize": "entityId",
"#application": "alternateName"
}
}
]
{
"alternateName" : "application",
"alternateKey" : "PAYMENT.ORDER",
"entityId" : 1
}
As you can see the alt key specification, the fields are mapped as required. The only difference is the wildcard symbol, that is '#'. This means that you should assign the label of the input field to the output field and these are the wildcard symbols of jolt specification.
Read Code section for more information on these wild card symbols.
In this topic