i have a nodeJS script that listens to for a webhook and then adds the data to firebase, the following works well:
let data = {
addresses: event.data["addresses"],
code: event.data["code"],
created_at: event.data["created_at"],
exchange_rates: event.data["exchange_rates"],
expires_at: event.data["expires_at"],
pricing: event.data["pricing"]
};
However, the pricing json contains a lot of junk and i would only like to add a specific part of the pricing json, below is an example of the json:
"pricing": {
"theprice": "0000",
"junk": "111",
"junk1": 222,
"junk2": 333
},
I would only like to select 'theprice' from the json. I have tried the following:
pricing: event.data["pricing"],["theprice"]
However this does not work, what is the correct syntax?