Deki
Posts: 0
Joined: Tue Apr 15, 2014 4:53 pm

How to push to json array in DB from query service

I have a query service that I want to execute and push data into the already existing json array. When I add the javascript below to my JS in the array field inside the update query, it overwrites the existing values with the value below. I just want to be able to add onto what is already there...as well as delete based on what the secondElement is.

pre
return ["firstElement","secondElement"];
/pre

Yurii Orishchuk
Posts: 0
Joined: Fri Feb 14, 2014 8:20 am

How to push to json array in DB from query service

Hi Deki,

Unfortunatly there is no abiltity to change item field partially.

Thy only way to do it is:

1 Get current item field value(read or list/query service).

2 Modificate it with way you need(add some, delete some or alter some).

3 Update item field with full json value(update service).

Regards.

Return to “Issues”