Answer the question
In order to leave comments, you need to log in
How to add a structure to an array or update an existing element?
For example, there is the following object in the database.
{
"visitor_id": 1,
"counter": [
{
"name": "foo",
"value": 20
},
{
"name": "bar",
"value": 35
}
]
}
{
"name": "bar",
"value": 2
}
{
"visitor_id": 1,
"counter": [
{
"name": "foo",
"value": 20
},
{
"name": "bar",
"value": 37
}
]
}
{
"name": "foobar",
"value": 3
}
{
"visitor_id": 1,
"counter": [
{
"name": "foo",
"value": 20
},
{
"name": "bar",
"value": 35
},
{
"name": "foobar",
"value": 3
}
]
}
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question