I have a JSON doc of the following format:
{
"X": [
{
"a": "foo",
"b": "bar"
},
{
"a": "xyz",
"b": "cvb"
}
]
}
I need to pass this JSON object in my JS code and then need to fetch the value of "b" when I pass value of "a". Example: If I'm passing "foo" I want the output to be as "bar" and so on.
I'm writing this in MarkLogic so anyone who can help me with this?