I have a usecase where I need to do json to json conversion using javascript in Apigee.
I am new to javascript.Could someone please provide me with samples on this?
@Subbu R , Can we have more details like what kind of transformation you are trying to do ? What is the input json, what is the expected json ? A simple json conversion looks like below one, you can try execute same in browser console to see output.
var apigeek1 = { fname: "Anil", lname: "Sagar", company: "Apigee" } console.log(apigeek1) apigeek1.skills = ["NodeJS", "Apigee"] delete(apigeek1.lname) console.log(apigeek1)
You can also think about the json as an string in Javscript.
Javascript string functions are very similar to the Java ones. You can take a look into this:
Please refer to following for a sample API
https://github.com/apigee/api-platform-samples/tree/master/doc-samples/javascript-cookbook
User | Count |
---|---|
1 | |
1 | |
1 | |
1 | |
1 |