NOTE - The JsonPowerDB API port has been changed to 5577

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

Insert a json record in JsonPowerDB

edited August 2017 in How 2
To insert a single json record, JsonPowerDB provide 'PUT' command, request format for insert is as follows:

Example:

PUT request format from client:

{
            "token":"401400726|-363956312424328770|401400726",
            "dbName": "MyDataBase",
            "cmd" : "PUT",
            "rel" : "Employee",
            "templateStr": {
            "empID":"101"
                                   },
            "jsonStr": {
                            "empID":"101",              
                            "empSex":"M",
                            "empDed":0.0,
                            "empName":"ARPIT TODEWALE",
                            "empNet":0.0,
                            "empBasic":25000,
                            "empAllowance":0.0,
                            "empDsg":"TECHNICAL HEAD"
                           }
  }


Post above json request using HTTP post request method on following information:

            Url : ‘http://serverdomain:4567/api/iml
            Method: ‘POST’
            Content-Type: ‘application/json’


In above PUT request format only empID will be indexed as it is provided in templateStr and the data inside the jsonStr will be stored   in jsonPowerDB. For more information about request variables click here. if the data will successfully stored in JsonPowerDB then server will return following json response.

 PUT response format from server:

                {
                "status":200,
                "data":"",
                "message":"RELATION CREATED, TEMPLATE CREATED,
                                     DATA INSERTED"
                }


For Inserting multiple records at a time in JsonPowerDB, Follow this link.

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!