-
Notifications
You must be signed in to change notification settings - Fork 1
Basic
Jair Andres Diaz Puentes edited this page Mar 15, 2018
·
3 revisions
Use {{ }} notation to fill out a template with data to generate a new JSON
var template = {
"menu": {
"flavor": "{{flavor}}",
"richness": "{{richness}}",
"garlic amount": "{{garlic_amount}}",
"green onion?": "{{green_onion}}",
"sliced pork?": "{{pork_amount}}",
"secret sauce": "{{sauce_amount}}",
"noodle's texture": "{{texture}}"
}
}
var data = {
"flavor": "strong",
"richness": "ultra rich",
"garlic_amount": "1 clove",
"green_onion": "thin green onion",
"pork_amount": "with",
"sauce_amount": "double",
"texture": "extra firm"
}
Select and transform
ST.select(template)
.transform(data)
.root();
Get the result
{
"menu": {
"flavor": "strong",
"richness": "ultra rich",
"garlic amount": "1 clove",
"green onion?": "thin green onion",
"sliced pork?": "with",
"secret sauce": "double",
"noodle's texture": "extra firm"
}
}