I have a JSON of form:
{
"array":[
{
"node1":"value1",
"node2":"value2"
},
{
"node1":"value1",
"node2":"value2"
}
]
}
Now I have a Front End GUI from where I receive 2 parameters that need to be inserted in the array.
But if the first parameter value1
is already in the array then I just need to update the corresponding value2
in my database.
If value1
is not present in array then insert a new object {"node1":"value1","node2":"value2"}
in the array.
I need to do this using mLAB APIs. Reading the docs didn't help me to come up with the solution.