NOTE - The JsonPowerDB API port has been changed to 5577

Old Request: http://serverdomain:4567/...
New Request: http://serverdomain:5577/...

Update values of a Json row stored in JsonPowerDB?

edited September 2017 in How 2

To update values of a json row in JsonPowerDB provide 'UPDATE' command, it can update multiple values at a time. following shows how to make update request to JsonPowerDB server.

   UPDATE request format:

{
"token":"401400726|-363956312424328770|401400726", "cmd":"UPDATE",
"dbName":"MyDataBase",
"rel":"Employee",
"jsonStr":{
                "1":{"empID":"110","empBasic":30000}
               }
}

In update json request we provide record number as a key and its   corresponding value is json object containing new value by which old   value will replace, In above example value of empID and empBasic will updated by new values of record number '1' of a given relation.

Post above json request to the server using HTTP post request method on following information.

Method: ‘POST’
Content-Type: ‘application/json’

 

   UPDATE response format:

{
"data":{ "1":{"empID":"101","empBasic":25000}}, "message":"Success",
"status":200
}

After successfully updated data server will return a response in json format as above, containing old values which has been updated.




Sign In or Register to comment.

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!