Close Menu Login2XplorE Home Docs Contact
J PDB   

JPDB API Command Reference


Language Syntax

All JPDB syntax follows JSON Syntax Rules.
< . . . >       - User specified value.
<< . . . >>   - Optional parameter, may take default value if not used.
|                - OR, One of the specified values must be chosen.
. . .             - Ellipsis, indicating more values can be inserted if required.

Setup Instructions

# Connection Token - Connecting to JPDB API.

  • Connection-token is used to interact with JsonPowerDB, it must be included in every request of jsonPowerDB for security purpose.

# How to get the 'connection-token' from JsonPowerDB :

  • Login to JPDB API Dashboard .
  • Click on Tools option on left navigation .
  • Select Tokens panel and then select 'connection-token' option from dropdown ,
  • Copy the 'connection-token' from the Token table.
  • And if there is no 'connection-token' in the token table or if you want to generate a new 'connection-token', click on the Generate Connection_Token button as It will generate a new-connection token.
  • Copy the newly generated 'connection-token' from token table.

# Response Headers in JPDB :

    One or more of the following information may be returned in the response, all of which give time in milliseconds unit. All information will be returned with IML, IRL, IDL, ISL APIs.
  • serverTime - Time between receiving request and returning response by JsonPowerDB Server.
  • reqResTime - Time taken to convert request to reponse by the API (not in the KVP API). It's the combination of parseTime and execTime.
  • parseTime -Time taken to parse and validate the request.
  • execTime - Actual time of executing the validated request.

Commands

# IML (JPDB Index Manipulation Language) - To insert, update and delete Json data.

Http method : POST
Base url : http://api.login2explore.com:5577
End-point url : /api/iml (mentioned in command when different)
dbName : Optional, if omitted will take the default database-name ("pi_db").
rel : Optional, if omitted will take the default relation-name ("root").
colsAutoIndex : Optional, can be used to automatically index all the new columns (default true).
templateStr : Optional, only valid at the time of creating a relation, in all following requests it is ignored.

- In 'json-template-data', the keys are column names and used to create specified indexes with the type of data it contains, but data itself is not stored.
- If not used, all the columns of the first row of data in 'jsonStr' will be indexed.
- The key colsAutoIndex must be set false, if templateStr is given in request.
Note : If we try to insert different datatype into indexed columns then indexing is done as datatype of the column, but the data is stored as the datatype we have entered.

Example :
column datatype : long
- inserted data : "1234", indexed data : 1234, retrieved data : "1234" ;
- inserted data : "Smith", indexed data : 0, retrieved data : "Smith" ;
- inserted data : "1234Smith", indexed data : 0, retrieved data : "1234Smith" ;
- inserted data : 45.9, indexed data : 45, retrieved data : 45.9 ;
- inserted data : false, indexed data : 0, retrieved data : false ;

                                                
{
    "token": <"connection-token">,
    "cmd": "PUT",
    <<"dbName": <"database-name">,>>
    <<"rel": <"relation-name">,>>
    <<"colsAutoIndex": <boolean-value>,>>
    <<"templateStr": <json-template-data>,>>
    "jsonStr": <json-data>
}
                                                
                                            
                                                
Using Javascript? Include following Javascript file to easily create the PUT request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create PUT request is - createPUTRequest(token, jsonObj, dbName, relName);
                                                
                                            
                                            
{
    "token": "-1935843913|3223940520357615501|-1935843909",
    "cmd": "PUT",
    "dbName": "Student",
    "rel": "Student-Rel",
    "jsonStr": {
        "id": "1",
        "name": "Soniya",
        "email": "soniya@gmail.com",
        "mobileno": "9967825671"
    }
}                           
                                                
                                            
                                                
{
    "data": {
        "rec_no": [1]
    },
    "additionalData": {
        "processReqType": 0,
        "dbUpdateFlag": true
    },
    "message": "DATA INSERTED, Total 1 rows are inserted, Added 0 columns as New Index Columns.",
    "status": 200
}         
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or exceeding limits.
dbName : Optional, if omitted will take the default database-name("pi_db").
rel : Optional, if omitted will take the default relation-name("root").
templateStr : Optional, only valid at the time of creating a relation, in all following requests it is ignored.

- In 'json-template-data', the keys are column names and used to create specified indexes with the type of data it contains, but data itself is not stored.
- If not used, all the columns of the first row of data in 'jsonStr' will be indexed.
- The key colsAutoIndex must be set false, if templateStr is given in request.
colsAutoIndex : Optional, can be used to automatically index all the new columns (default true).
Note : If we try to insert different datatype into indexed columns then indexing is done as datatype of the column, but the data is stored as the datatype we have entered.

Example :
column datatype : long
- inserted data : "1234", indexed data : 1234, retrieved data : "1234" ;
- inserted data : "Smith", indexed data : 0, retrieved data : "Smith" ;
- inserted data : "1234Smith", indexed data : 0, retrieved data : "1234Smith" ;
- inserted data : 45.9, indexed data : 45, retrieved data : 45.9 ;
- inserted data : false, indexed data : 0, retrieved data : false ;

                                            
{
    "token": <"connection-token">,
    "cmd": "PUT_ALL",
    <<"dbName": <"database-name">,>>
    <<"rel": <"relation-name">,>>
    <<"colsAutoIndex": <boolean-value>,>>
    <<"templateStr": <json-template-data>,>>
    "jsonStr": <[json-data-array]>
}
                                                
                                            
                                            
{
    "token": "608862679|6881615562961411263|608862579",
    "cmd": "PUT_ALL",
    "dbName": "Employee",
    "rel": "index",
    "templateStr": {},
    "colsAutoIndex": true,
    "jsonStr": [
        {
            "name": "Pranitha",
            "email": "pranitha@gmail.com",
            "password": "3293",
            "passwrd": "3293"

        },
        {
            "name": "Sarah Khan",
            "email": "sarahkhan@gmail.com",
            "password": "3823",
            "passwrd": "3823"

        },
        {
            "name": "Akhil",
            "email": "akhil81@gmail.com",
            "password": "3273",
            "passwrd": "3273"

        }
    ]
}                          
                                                
                                            
                                                
{
    "data": {
        "rec_no": [12,13,14]
    },
    "additionalData": {
        "processReqType": 0,
        "dbUpdateFlag": true
    },
    "message": "DATA INSERTED, Total 3 rows are inserted, Added 0 columns as New Index Columns.",
    "status": 200
}

                                                 
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or exceeding limits.
dbName : Optional, if omitted will take the default database-name("pi_db").
rel : Optional, if omitted will take the default relation-name("root").

                                            
{
    "token": <"connection-token">,
    "cmd": "UPDATE",
    <<"dbName": "database-name",>>
    <<"rel": "relation-name",>>
    "jsonStr": {
        <"record-no">: {
            <"column-name">: <"new-value">
        }
        <"record-no">: {
            <"column-name">: <"new-value">
        }
    }
}
                                                
                                            
                                                
Using Javascript? Include following Javascript file to easily create the UPDATE request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create UPDATE request for one record is - createUPDATERecordRequest(token, jsonObj, dbName, relName, recNo);
                                                
                                            
                                            
{
    "token": "90937075|-31948812362179105|90938333",
    "cmd": "UPDATE",
    "dbName": "Employee-DB",
    "rel": "Employee",
    "jsonStr": {
       "3":{
        "full_name": "Gargee Mishra",
        "email_address":"gargee@gmail.com",
        "mobile_number": 7098162348 

      },
       "6":{
        "full_name":"Kanishk Mishra",
        "email_address":"kanishk@gmail.com",
        "mobile_number": 9000876578
      },
       "5":{
        "full_name":"Sulbha Mishra",
        "email_address":"sulbha@gmail.com"
      }
   }
}                                               
                                            
                                                
{
    "data": {
        "3": {
            "full_name":"gargee",
            "email_address": "gargee@gmail.com",
            "mobile_number": "8989890011"
        },
        "5": {
            "full_name": "kanishk mishra",
            "email_address": "mishra@gmail.com",
            "mobile_number": "9000876578"
        },
        "6": {
            "full_name": "sulbha misra",
            "email_address": "sulbha@gmail.com",
            "mobile_number": "8090712341"
        },
        "NewIndexColumnCreated": 0,
        "NewNonIndexColumnCreated": 0
    },
    "additionalData": {
        "processReqType": 0,
        "dbUpdateFlag": true
    },
    "message": "Success",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or invalid record number.
End-point url : /api/iml/set
dbName : Optional, omitted will take the default database-name("pi_db").
rel : Optional, omitted will take the default relation-name("root").
templateStr : Optional, only valid at the time of creating a relation, in all following requests it is ignored.

- In 'json-template-data', the keys are column names and used to create specified indexes with the type of data it contains, but data itself is not stored.
- If not used, all the columns of the first row of data in 'jsonStr' will be indexed.
- The key colsAutoIndex must be set false, if templateStr is given in request.
colsAutoIndex : Only used when type is PUT, it is optional and can be used to automatically index all the new columns (default true).
type : Optional, omitted will take the default type("DEFAULT"). There are 3 type

1. PUT :
a. PUT if primary key is not present, else return an error message.
b. While PUT checks no uniqueKeys[] should be present in that relation. If any uniqueKey is present, return an array of present unique key and error.

2. UPDATE :
a. UPDATE if primary key is present else return an error message.
b. While UPDATE checks no uniqueKeys[] should be present in that relation except for the record that is updating, else return an array of present unique key and error.

3. DEFAULT :
a. Behaves like PUT (insert) if value of “primaryKey” is not present else UPDATE (modify) record.
uniqueKeys : Optional, omitted will only use primary key.
foreignKeys : Optional, can have multiple foreignKey references.
  • foreignKey - the column in dbName that will link the foreign reference, only accepts index columns.
  • inDb - database of the foreign column. An optional key, default is the database mentioned in dbName.
  • inRel - relation of the foreign column. An optional key, default is the relation mentioned in rel.
  • inCol - column that is the foreign reference.
  • optional - flag for the presence of foreign key value. When set true then the foreignKey column can have null or empty data or be skipped in jsonStr but not when set to false. An optional key, default is false.
Note : If we try to insert different datatype into indexed columns then indexing is done as datatype of the column, but the data is stored as the datatype we have entered.

Example :
column datatype : long
- inserted data : "1234", indexed data : 1234, retrieved data : "1234" ;
- inserted data : "Smith", indexed data : 0, retrieved data : "Smith" ;
- inserted data : "1234Smith", indexed data : 0, retrieved data : "1234Smith" ;
- inserted data : 45.9, indexed data : 45, retrieved data : 45.9 ;
- inserted data : false, indexed data : 0, retrieved data : false ;

                                                
{
    "token": <"connection-token">,
    "cmd": "SET",
    <<"dbName": <"database-name">,>>
    <<"rel": <"relation-name">,>>
    <<"colsAutoIndex": <boolean-value>,>>
    <<"templateStr": <json-template-data>,>>
    <<"uniqueKeys": <["unique-key1",...]>,>>
    <<"foreignKeys" : <[
       {"foreignKey": <"column-name">,
        <<"inDb": <"database-name">,>>
        <<"inRel": <"relation-name">,>>
        "inCol": <"foreign-column-name">,
        <<"optional": <boolean-value> >>
    },...]>, >>
    <<"type": <"type">,>>
    "primaryKey": <"primary-key">,
    "jsonStr":<"json-data">
}
                                                
                                            
                                                
Using Javascript? Include following Javascript file to easily create the SET request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create SET request is - createSETRequest(token, jsonStr, dbName, relName, type, primaryKey, uniqueKeys, foreignKeys);
                                                
                                            
                                            
{
    "token": "608862679|6881615571065068944|608862465",
    "cmd": "SET",
    "dbName": "Employee",
    "rel": "EMPLOYEE_DETAIL",
    "type": "PUT",
    "primaryKey": "Email-address",
    "uniqueKeys": ["User-name", "Phone-number"],
    "foreignKeys": [
       {"foreignKey": "Mgr-ID",
        "inCol": "ID",
        "optional": true}
    ],
    "jsonStr": {
        "ID" : 2901,
        "User-name": "kanishk",
        "Name": "kanishk kanna",
        "Email-address": "kanishk@gmail.com",
        "Phone-number": 8790654321,
        "Address": "plasia road",
        "Mgr-ID" : ""
    }

}                                                
                                            
                                                
{
    "data": {
        "rec_no": [7],
        "old_records": []
    },
    "additionalData": {
        "processReqType": 0,
        "dbUpdateFlag": true
    },
    "message": "DATA INSERTED , Total 1 rows are inserted, Added 0 columns as New Index Columns.",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or exceeding limits.
End-point url : /api/iml/set
dbName : Optional, omitted will take the default database-name("pi_db").
rel : Optional, omitted will take the default relation-name("root").
templateStr : Optional, only valid at the time of creating a relation, in all following requests it is ignored.

- In 'json-template-data', the keys are column names and used to create specified indexes with the type of data it contains, but data itself is not stored.
- If not used, all the columns of the first row of data in 'jsonStr' will be indexed.
- The key colsAutoIndex must be set false, if templateStr is given in request.
colsAutoIndex : Only used when type is PUT, it is optional and can be used to automatically index all the new columns (default true).
type : Optional, omitted will take the default type("DEFAULT"). There are 3 type

1. PUT :
a. PUT if primary key is not present, else return an error message.
b. While PUT checks no uniqueKeys[] should be present in that relation. If any uniqueKey is present, return an array of present unique key and error.

2. UPDATE :
a. UPDATE if primary key is present else return an error message.
b. While UPDATE checks no uniqueKeys[] should be present in that relation except for the record that is updating, else return an array of present unique key and error.

3. DEFAULT :
a. Behave like PUT if “primaryKey” is not present else UPDATE.
uniqueKeys : Optional, omitted will only use primary key.
foreignKeys : Optional, can have multiple foreignKey references.
  • foreignKey - the column in dbName that will link the foreign reference, only accepts index columns.
  • inDb - database of the foreign column. An optional key, default is the database mentioned in dbName.
  • inRel - relation of the foreign column. An optional key, default is the relation mentioned in rel.
  • inCol - column that is the foreign reference.
  • optional - flag for the presence of foreign key value. When set true then the foreignKey column can have null or empty data or be skipped in jsonStr but not when set to false. An optional key, default is false.
Note : If we try to insert different datatype into indexed columns then indexing is done as datatype of the column, but the data is stored as the datatype we have entered.

Example :
column datatype : long
- inserted data : "1234", indexed data : 1234, retrieved data : "1234" ;
- inserted data : "Smith", indexed data : 0, retrieved data : "Smith" ;
- inserted data : "1234Smith", indexed data : 0, retrieved data : "1234Smith" ;
- inserted data : 45.9, indexed data : 45, retrieved data : 45.9 ;
- inserted data : false, indexed data : 0, retrieved data : false ;

                                            
{
    "token": <"connection-token">,
    "cmd": "SET_ALL",
    <<"dbName": <"database-name">,>>
    <<"rel": <"relation-name">,>>
    <<"colsAutoIndex": <boolean-value>,>>
    <<"templateStr": <json-template-data>,>>
    <<"uniqueKeys": <["unique-key1",...]>,>>
    <<"foreignKeys" : <[
       {"foreignKey": <"column-name">,
        <<"inDb": <"database-name">,>>
        <<"inRel": <"relation-name">,>>
        "inCol": <"foreign-column-name">,
        <<"optional": <boolean-value> >>
    },...]>, >>
    <<"type": <"type">,>>
    "primaryKey": <"primary-key">,
    "jsonStr": <[json-data-array]>
}
                                                
                                            
                                                
Using Javascript? Include following Javascript file to easily create the SET_ALL request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create SET_ALL request is - createSET_ALLRequest(token, jsonStr, dbName, relName, type, primaryKey, uniqueKeys, foreignKeys);
                                                
                                            
                                            
{
    "token": "608862679|6881615571065068944|608862465",
    "cmd": "SET_ALL",
    "dbName": "Employee",
    "rel": "EMPLOYEE_DETAIL",
    "type": "DEFAULT",
    "primaryKey": "Email-address",
    "uniqueKeys": ["User-name", "Phone-number"],
    "foreignKeys": [
       {"foreignKey": "Mgr-ID",
        "inCol": "ID",
        "optional": true}
    ],
    "jsonStr": [
        {
            "ID" : 280,
            "User-name": "amishra",
            "Email-address": "aayushi@gmail.com",
            "Address": "gandhi nagar"
        },
        {
            "ID" : 285,
            "User-name": "jayesh",
            "Name": "jayesh kanna",
            "Email-address": "jayesh@gmail.com",
            "Phone-number": 7865431289,
            "Address": "Airport Road",
            "Mgr-ID" : 280
        },
        {
            "User-name": "garvit",
            "Name": "garvit kanna",
            "Email-address": "garvit@gmail.com",
            "Phone-number": 6789654312,
            "Address": "Madhumilan square",
            "Mgr-ID" : 280
        }

    ]
}  
                                            
                                                
{
    "data": {
        "rec_no": [5, 6],
        "old_records": [{
                "3": {
                    "Address": "kalani nagar",
                    "Email-address": "aayushi@gmail.com",
                    "User-name": "aayushi"
                },
                "NewIndexColumnCreated": 0,
                "NewNonIndexColumnCreated": 0
            }]
    },
    "additionalData": {
        "processReqType": 0,
        "dbUpdateFlag": true
    },
    "message": "DATA INSERTED , Total 2 rows are inserted, Added 0 columns as New Index Columns.",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or exceeding limits.
dbName : Optional, if omitted will take the default database-name("pi_db").
rel : Optional, if omitted will take the default relation-name("root").

                                            
{
    "token": <"connection-token">,
    "cmd": "REMOVE",
    <<"dbName": <"database-name">,>>
    <<"rel": <"relation-name">,>>
    "record": <record-number | [record-number1,...] | {"range":[from-rec-no,to-rec-no]}>
    "jsonStr" : {}
}
                                                
                                            
                                                
Using Javascript? Include following Javascript file to easily create the REMOVE request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create REMOVE request is - createREMOVERecordRequest(token, dbName, relName, reqId);
                                                
                                            
                                            
{
    "token": "401400726|-363956312424328770|401400726",
    "cmd": "REMOVE",
    "dbName": "Company",
    "rel": "Employee",
    "record": 1,
    "jsonStr" : {}
}                                
                                                
                                            
                                                
{
    "data": {
        "removedRecNos":[1],
        "alreadyRemovedRecNos":[],
        "invalidRecNos":[]
    },
    "message": "Success",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or invalid record number.


Pluggable APIs:-
If the any of the following pluggable commands are not working in your instance, please email with details at support@login2explore.com

End-point url : /jpdb/iml/col/v01/copy
token : token should be present in header of request but it can also be present in body of request but it is deprecated.
dbName : It contains database name.
rel : It contains relation name.
jsonStr : It is an array of arrays where in each array contains an existing column name at index 0 and new column name at index 1.
forceUpdate : If it is true, that means if copy column is exists in database, then it will override data of copy column.
                                            
{
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    "jsonStr"   : <[["col-name1","copy-col-name1"],...]>,
    <<"forceUpdate": <boolean-value>,>>
}
                                                
                                            
                                            
{
    "dbName": "Employee_DB",
    "rel": "Employee",
    "jsonStr": [["Name", "emp_name"], ["Email-address", "emp_email_id"]],
    "forceUpadte": true
}
                                                
                                            
                                                
{
    "data": "{}",
    "message": "2 Columns Copied",
    "status": 200
}
                                               
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or invalid record number.
End-point url : /jpdb/iml/col/v01/rename
token : token should be present in header of request but it can also be present in body of request but it is deprecated.
dbName : It contains database name.
rel : It contains relation name.
jsonStr : It is an array of arrays where in each array contains an old column name and new column name.
                                            
{
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    "jsonStr"   : <[["old-col-name1”,”new-col-name1"],...]>,
}
                                                
                                            
                                            
{
    "dbName": "Employee_DB",
    "rel": "Employee",
    "jsonStr": [["Phone-number", "EMP_MOBILE_NUMBER"], ["Name", "EMP_NAME"], ["Address", "EMP_ADDRESS"]]
}
                                                
                                            
                                                
{
    "data": "{}",
    "message": "3 Columns Renamed",
    "status": 200
}
                                               
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or invalid record number.
End-point url : /jpdb/iml/col/v01/remove
token : token should be present in header of request but it can also be present in body of request but it is deprecated.
dbName : It contains database name.
rel : It contains relation name.
jsonStr : It is an array of column names which are supposed to be deleted.
                                            
{
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    "jsonStr"   : <["col-name1",...]>,
}
                                                
                                            
                                            
{
    "dbName": "Employee_DB",
    "rel": "Employee",
    "jsonStr": ["EMP_MOBILE_NUMBER","EMP_NAME","EMP_ADDRESS"]
}
                                                
                                            
                                                
{
    "data": "{}",
    "message": "3 Columns Removed",
    "status": 200
}
                                               
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or invalid record number.
End-point url : /jpdb/iml/col/v01/changetype
token : token should be present in header of request but it can also be present in body of request but it is deprecated.
dbName : It contains database name.
rel : It contains relation name.
jsonStr : It is an array of arrays where in each array contains an existing column name at index 0 and new data type at index 1.
                                            
{
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    "jsonStr"   : <[["col-name1","data-type1"],...]>,
}
                                                
                                            
                                            
{
    "dbName": "Employee_DB",
    "rel": "Employee",
    "jsonStr": [["EMP_MOBILE_NUMBER","Long"],["EMP_NAME","String"],["EMP_ADDRESS","String"],["SALARY_ABOVE_40000","Boolean"]]
}
                                                
                                            
                                                
{
    "data": "{}",
    "message": "3 Columns data type changed",
    "status": 200
}
                                               
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or invalid record number.
End-point url : /jpdb/iml/col/v01/merge
It will help us to merge two columns. One of two values will be selected between both the columns. If any one value is null then the other value is selected. To remove the ambiguity if two values are there then it will be decided based on forceReplace flag. If forceReplace is false then the value selected will be from tarCol or srcCol2 else the value will be selected from srcCol1. There are two way of merging the columns:- :-
  • Firstly, we can merge srcCol1 and srcCol2 to trgCol (The trgCol must be a new column).
  • Secondly, we can merge srcCol1 to trgCol (The trgCol must be an existing column).
token : token should be present in header of request but it can also be present in body of request but it is deprecated.
dbName : It contains database name.
rel : It contains relation name.
forceReplace : Optional, it is used to remove the ambiguity if two values are there then it will be decided based on forceReplace flag. If forceReplace is false then the value selected will be from tarCol or srcCol2 else the value will be selected from srcCol1 (By default its value is true).
srcCol1 : It contains the name of first source column that has to be merged.
delSrcCol1 : It contains a boolean value which tells whether the source column 1 should be deleted or not after merging is done.
  • If delSrcCol1 is false then the column will not be deleted after merging (by default its value is false).
  • If delSrcCol1 is true then the column will be deleted after merging
srcCol2 : Optional, It contains the name of second source column that has to be merged
delSrcCol2 : It contains a boolean value which tells whether the source column 2 should be deleted or not after merging is done.
  • If delSrcCol2 is false then the column will not be deleted after merging (by default its value is false).
  • If delSrcCol2 is true then the column will be deleted after merging
tarCol : It contains the name of target colums.
  • If srcCol2 is not present then the column name should be existing columns.
  • If srcCol2 is present then the column name should be a new column.
tarColType : Optional, it contains the type of data which the target column should have. If it is not present then it will automatically find the highest data type among the column. The data type that it can support are
  • Long
  • Double
  • String
  • Boolean
                                            
{
"dbName": <"database-name">,
"token": <"connection-token">,
"rel": <"relation-name">,
      "jsonStr": {
             << "forceReplace":  true / false, >>    // default value => true - replace existing value of trgCol if set true
            "srcCol1" : "colName1",
            "delSrcCol1" : true / false,        // default value => false
            <<"srcCol2" : "colName2",
            <<"delSrcCol2" : true / false; >> >>        // default value => false
            "tarCol" : "colName3",
            <<"tarColType" : "String" | "Double" | "Long" | "Boolean"       >>                 // by default the highest colType will be used otherwise the given type will be modified.
       }
}
                                                
                                            
                                            
{
    "dbName": "SAMPLE",
    "rel": "SAMPLE-REL",
    "jsonStr": {
        "forceReplace":false,     
            "srcCol1" : "firstName",
            "delSrcCol1" : false,      
            "srcCol2" : "lastName",
            "delSrcCol2" :  false,
            "tarCol" : "fullName"
            "tarColType": "String"
    }
}
                                                
                                            
                                                
{
  "data": "{\"changeType\":{},\"copyCol\":{}}",
  "message": "firstName and lastName merged in new column fullName",
  "status": 200
}
                                               
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or invalid record number.

# IRL (JPDB Index Retrieval Language) - To retrieve Json data.

Http method : POST
Base url : http://api.login2explore.com:5577
End-point url : /api/irl
                                                
{
    "token": <"connection-token">, 
    "cmd": "GET",
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    "jsonStr": {
        <"column-name">:<"column-value">
    }
} 
                                                
                                            
                                                
GET returns only first record that matches json value in that column.
Using Javascript? Include following Javascript file to easily create the GET request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create GET request is - createGETRequest(token, dbname, relationName, jsonObjStr);
                                                
                                            
                                                
{
    "token": "2134770734|1905622745244281054|2134771272",
    "cmd": "GET",
    "dbName": "Company",
    "rel": "Employee",
    "jsonStr":{
        "empName": "Arpit Todewal"
    }
}  
                                                
                                            
                                                
{
    "data": {
                "empID": "PHP101","empDed": 523.0, "empName": "Arpit Todewal",
                "empBasic": 25000, "empAllowance": 659.0, "empDsg": "TECHNICAL HEAD"
    },
    "message": "DATA RETRIEVED FROM PI",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or data not found.
                                                
{
    "token": <"connection-token">, 
    "cmd": "GET_BY_KEY",
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    <<"createTime": <boolean-value>,>>
    <<"updateTime": <boolean-value>,>>
    "jsonStr": {
        <"column-name">: <"column-value">
    }
} 
                                                
                                            
*  GET_BY_KEY only works with indexed columns and returns only first record that matches json value in that column.
                                                
Using Javascript? Include following Javascript file to easily create the GET_BY_KEY request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create GET_BY_KEY request is - createGET_BY_KEYRequest(token, dbname, relationName, jsonObjStr, createTime, updateTime);
                                                
                                            
                                                
{
    "token": "608862679|6881615563234464505|608862542",
    "dbName": "INDORE-TERAPANTH-DIRECTORY",
    "cmd": "GET_BY_KEY",
    "rel": "MEMBERS-FAMILY",
    "createTime": true,
    "updateTime": true,
    "jsonStr": {
        "name": "Mrs. Mamta Modi"
    }

}
                                                
                                            
                                                
{
    "data": {
        "rec_no": 1,
        "created": 1573124919206,
        "record": {
            "regNo": "201",
            "bloodGroup": "A+",
            "name": "Mrs. Mamta Modi",
            "mobile": "8349999434",
            "memberOf": "TMM"
        },
        "updated": 1573124919206
    },
    "message": "DATA RETRIEVED FROM PI",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or data not found.
                                                
{
    "token": <"connection-token">, 
    "cmd": "GET_ALL",
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    <<"timeStamp":<time-stamp>,>>
    <<"cols":<< "*" > | <["col1",...]>,>>
    <<"pageNo":<page-number>,>>
    <<"pageSize":<page-size>,>>
    <<"createTime": <boolean-value>,>>
    <<"updateTime": <boolean-value> >>
        
} 
                                                
                                            
Either timeStamp should be provided or pageNo and pageSize, If all 3 are provided then timestamp will be considered and records are given according to timestamp value.
If all 3 are not provided then it will give defalut page Number and default page size records.
If timestamp value is zero than it will give all records of relation.
If we provide timestamp it will give only new ,modified and deleted data after every timestamp.
cols: Columns which you want to retrieve.
  • < "*" > : If you want to retrieve all the cols.
  • ["col1" , . . . ] : A JSONArray of col-names containing all the cols that you want to retrieve
Default page size : 100
Default page Number : 1
                                                
{
    "token": "608862679|6881615563234464505|608862542",
    "dbName": "INDORE-TERAPANTH-DIRECTORY",
    "cmd": "GET_ALL",
    "rel": "MEMBERS-FAMILY",
    "pageNo": 1,
    "pageSize": 5,
    "createTime": true,
    "updateTime": true
}

                                                
                                            
                                                
{
    "data": {
        "file_status": "OK",
        "total_records": 1190,
        "json_records": [{
                "rec_no": 1,
                "created": 1573124919206,
                "record": {
                    "regNo": "201",
                    "bloodGroup": "A+",
                    "name": "Mrs. Mamta Modi",
                    "mobile": "8349999434",
                    "memberOf": "TMM"
                },
                "updated": 1573124919206
            }, {
                "rec_no": 2,
                "created": 1573124919206,
                "record": {
                    "regNo": "201",
                    "bloodGroup": "",
                    "name": "Amit Modi",
                    "mobile": "",
                    "memberOf": "TYP"
                },
                "updated": 1573124919206
            }],
        "total_pages": 595,
        "current_page": 1
    },
    "message": "DATA RETRIEVED FORM PI",
    "status": 200
}

                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or relation does not exist.
                                                
{
    "token": <"connection-token">,   
    "cmd": "FIND_ALL_RECORDS",
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    "jsonStr": {
        <"column-name">:<"column-value">
    },
    <<"createTime": <boolean-value>,>>
    <<"updateTime": <boolean-value> >>
        
}
                                                
                                            
*  FIND_ALL_RECORDS works with non-indexed columns as well and returns all records that match json value in that column.
                                                
Using Javascript? Include following Javascript file to easily create the FIND_ALL_RECORDS request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create FIND_ALL_RECORDS request is - createFIND_ALL_RECORDSRequest(token, dbName, relName, jsonObjStr, createTime, updateTime);
                                                
                                            
                                                
{
    "token": "608862679|6881615563234464505|608862542",
    "dbName": "INDORE-TERAPANTH-DIRECTORY",
    "cmd": "FIND_ALL_RECORDS",
    "rel": "MEMBERS",
    "jsonStr": {
        "bloodGroup": "O+"
    },
    "createTime": true,
    "updateTime": true

}
                                                
                                            
                                                
{
    "data": [{
            "rec_no": 2,
            "created": 1573124919039,
            "record": {
                "regNo": "202",
                "profession": "Durga Parts & Lubricants",
                "address": "201, Gold-Petels\r\n16\/2, South tukoganj\r\nNear Sahaj Hospital\r\nIndore - 452001",
                "mobile": "7000089795",
                "reference": "347",
                "bloodGroup": "",
                "zone": "5",
                "name": "Bahadur Singh Sancheti",
                "nativePlace": "Sardarsahr (Rajasthan)",
                "businessAddress": "Durga Sales Agencies\r\n9\/47, Sapna Sangeeta Road\r\nSneh Nagar, Indore- 452001 (M.P.)",
                "email": "",
                "contactNo": "07312512047"
            },
            "updated": 1573124919039
        }],
    "message": "Success",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or data not found.
                                                
{
    "token": <"connection-token">,   
    "cmd": "GET_RECORD",
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    "record": <record-number>
}
                                                
                                            
                                                
Using Javascript? Include following Javascript file to easily create the GET_RECORD request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create GET_RECORD request is - createGET_RECORDRequest(token, dbName, relName, record);
                                                
                                            
                                                
{
    "token": "401400726|-363956312424328770|401400726",   
    "cmd": "GET_RECORD",
    "dbName": "Company",
    "rel": "Employee",
    "record": 1
}
                                                
                                            
                                                
{
    "data":
            {
                "empID": "PHP101","empDed": 523.0, "empName": "Arpit Todewal",
                "empBasic": 25000, "empAllowance": 659.0, "empDsg": "TECHNICAL HEAD"
            },
    "message": "Success",
    "status": 200
}                                                   
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or invalid record number.
                                                
{
    "token": <"connection-token">,   
    "cmd": "GET_BY_RECORD",
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    "record": <record-number>,
    <<"createTime": <boolean-value>,>>
    <<"updateTime": <boolean-value> >>
}
                                                
                                            
                                                
Using Javascript? Include following Javascript file to easily create the GET_BY_RECORD request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create GET_BY_RECORD request is - createGET_BY_RECORDRequest(token, dbName, relName, record, createTime, updateTime);
                                                
                                            
                                                
{
    "token": "608862679|6881615563234464505|608862542",
    "dbName": "INDORE-TERAPANTH-DIRECTORY",
    "cmd": "GET_BY_RECORD",
    "rel": "MEMBERS-FAMILY",
    "record": 2,
    "createTime": true,
    "updateTime": true
}
                                                
                                            
                                                
{
    "data": {
        "rec_no": 2,
        "created": 1573124919206,
        "record": {
            "regNo": "201",
            "bloodGroup": "",
            "name": "Amit Modi",
            "mobile": "",
            "memberOf": "TYP"
        },
        "updated": 1573124919206
    },
    "message": "Success",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or invalid record number.
                                                
{
    "token": <"connection-token">, 
    "cmd": "FIRST_RECORD",
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    <<"createTime": <boolean-value>,>>
    <<"updateTime": <boolean-value> >>
} 
                                                
                                            
                                                
Using Javascript? Include following Javascript file to easily create the FIRST_RECORD request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create FIRST_RECORD request is -createFIRST_RECORDRequest(token, dbName, relName, createTime, updateTime) ;
                                                
                                            
                                                
{
    "token": "608862679|6881615563234464505|608862542",
    "dbName": "INDORE-TERAPANTH-DIRECTORY",
    "cmd": "FIRST_RECORD",
    "rel": "MEMBERS-FAMILY",
    "createTime": true,
    "updateTime": true
}
                                                
                                            
                                                
{
    "data": {
        "rec_no": 1,
        "created": 1573124919206,
        "record": {
            "regNo": "201",
            "bloodGroup": "A+",
            "name": "Mrs. Mamta Modi",
            "mobile": "8349999434",
            "memberOf": "TMM"
        },
        "updated": 1573124919206
    },
    "message": "OK",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or BOF.
                                                
{
    "token": <"connection-token">, 
    "cmd": "LAST_RECORD",
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    <<"createTime": <boolean-value>,>>
    <<"updateTime": <boolean-value> >>

} 
                                                
                                            
                                                
Using Javascript? Include following Javascript file to easily create the LAST_RECORD request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create LAST_RECORD request is - createLAST_RECORDRequest(token, dbName, relName, createTime, updateTime);
                                                
                                            
                                                
{
    "token": "608862679|6881615563234464505|608862542",
    "dbName": "INDORE-TERAPANTH-DIRECTORY",
    "cmd": "LAST_RECORD",
    "rel": "MEMBERS-FAMILY",
    "createTime": true,
    "updateTime": true

}
                                                
                                            
                                                
{
    "data": {
        "rec_no": 1190,
        "created": 1573124919368,
        "record": {
            "regNo": "314",
            "bloodGroup": "A+",
            "name": "Rishi Sancheti",
            "mobile": "9424890261",
            "memberOf": "TYP"
        },
        "updated": 1573124919368
    },
    "message": "OK",
    "status": 200
}
                                           
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or EOF.
                                                
{
    "token": <"connection-token">, 
    "cmd": "NEXT_RECORD",
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    "record": <record-number>,
    <<"createTime": <boolean-value>,>>
    <<"updateTime": <boolean-value> >>
} 
                                                
                                            
                                                
Using Javascript? Include following Javascript file to easily create the NEXT_RECORD request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create NEXT_RECORD request is - createNEXT_RECORDRequest(token, dbName, relName, recordNumber, createTime, updateTime);
                                                
                                            
                                                
{
    "token": "608862679|6881615563234464505|608862542",
    "dbName": "INDORE-TERAPANTH-DIRECTORY",
    "cmd": "NEXT_RECORD",
    "rel": "MEMBERS-FAMILY",
    "record": 2,
    "createTime": true,
    "updateTime": true
}
                                                
                                            
                                                
{
    "data": {
        "rec_no": 3,
        "created": 1573124919206,
        "record": {
            "regNo": "202",
            "bloodGroup": "A+",
            "name": "Mrs. Pushpa Sancheti",
            "mobile": "9329547240",
            "memberOf": "TMM"
        },
        "updated": 1573124919206
    },
    "message": "OK",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or invalid record number.
message : EOF when last record is reached.
                                                
{
    "token": <"connection-token">, 
    "cmd": "PREV_RECORD",
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    "record": <record-number>,
    <<"createTime": <boolean-value>,>>
    <<"updateTime": <boolean-value> >>
} 
                                                
                                            
                                                
Using Javascript? Include following Javascript file to easily create the PREV_RECORD request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create PREV_RECORD request is - createPREV_RECORDRequest(token, dbName, relName, recordNumber, createTime, updateTime) ;
                                                
                                            
                                                
{
    "token": "608862679|6881615563234464505|608862542",
    "dbName": "INDORE-TERAPANTH-DIRECTORY",
    "cmd": "PREV_RECORD",
    "rel": "MEMBERS-FAMILY",
    "record": 2,
    "createTime": true,
    "updateTime": true

} 
                                                
                                            
                                                
{
    "data": {
        "rec_no": 1,
        "created": 1573124919206,
        "record": {
            "regNo": "201",
            "bloodGroup": "A+",
            "name": "Mrs. Mamta Modi",
            "mobile": "8349999434",
            "memberOf": "TMM"
        },
        "updated": 1573124919206
    },
    "message": "OK",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or invalid record number.
message : BOF , when first record is reached.
                                                
{
   "token": <"connection-token">, 
   "cmd": "GET_RELATION_STATS",
   "dbName": <"database-name">,
   "rel": <"relation-name">,
   <<"getDataSize": <"boolean-value">,>>
}
                                                
                                            
                                                
GET_RELATION_SIZE is deprecated.                                                  
Using Javascript? Include following Javascript file to easily create the GET_RELATION_STATS request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create GET_RELATION_STATS request is - createGET_RELATION_STATSRequest(token, dbname, relationName);
                                                
                                            
                                                
{
    "token": "2134770734|1905622745254386678|2134771170",
    "cmd": "GET_RELATION_STATS",
    "dbName": "Employee",
    "rel": "Details",
    "getDataSize": true
}  
                                                
                                            
                                                
{
    "data": "{
          "record_count":10,
          "relName":"Details",
          "rel_timestamp":1717751582740,
          "size":1478,
          "delete_count":40,
            }",
    "message": "Success",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax.
                                                
{
    "token": <"connection-token">, 
    "cmd": "GET_ALL_DB"
}
                                                
                                            
                                                
{
    "token": "2134770734|1905622745244281054|2134771272",
    "cmd": "GET_ALL_DB"
}  
                                                
                                            
                                                
{
    "data": [
        "Company"
    ],
    "message": "Success",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax.
                                                
{
    "token": <"connection-token">, 
    "cmd": "GET_DB_STATS",
    "dbName": <"database-name">,
    <<"getDataSize": <"boolean-value">,>>
}
                                                
                                            
                                                
{
    "token": "608862677|6881615657484689906|608862671",
    "cmd": "GET_DB_STATS",
    "dbName": "Employee-DB",
    "getDataSize": true
}  
                                                
                                            
                                                
{
    "data": [{
            "record_count": 9,
            "relName": "Admin-User",
            "rel_timestamp": 1573728947267,
            "delete_count": 1
            "size" : 712
        }, {
            "record_count": 0,
            "relName": "Admin-User_session",
            "rel_timestamp": 1573728960495,
            "delete_count": 7
            "size" : 514
        }, {
            "record_count": 7,
            "relName": "Employee",
            "rel_timestamp": 1573727990169,
            "delete_count": 1
            "size" : 602
        }],
    "message": "Success",
    "status": 200
}




                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or relation does not exist.
                                                
{
    "token": <"connection-token">, 
    "cmd": "GET_USER_STATS",   
    <<"getDataSize": <"boolean-value">,>>
}
                                                
                                            
                                                
{
    "token": "2134770734|1905622745408421709|2134771389",
    "cmd": "GET_USER_STATS",
    "getDataSize": true
} 
                                                
                                            
                                                
{
    "data": "{
          "indexCount":[12,1000],
          "userDataSizeCount":[2181,100000],
          "rowCount":[25,1000000],
          "relCount":[3,100],
          "dbCount":[2,10],
            }",
    "message": "Success",
    "status": 200
}                                          
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax.
                                                
{
    "token": <"connection-token">, 
    "cmd": "GET_INDEXED_COL",
    "dbName": <"database-name">,
    "rel": <"relation-name">
}
                                                
                                            
                                                
{
    "token": "2134770734|1905622745408421709|2134771389",
    "cmd": "GET_INDEXED_COL",
    "dbName": "databaseName",
    "rel": "relationName"
} 
                                                
                                            
                                                
{
    "data": [
        {"colName": "empAllowance", "colType": "Double" },
        {"colName": "empBasic", "colType": "Long" },
        {"colName": "empDed", "colType": "Double" },
        {"colName": "empDsg", "colType": "String" },
        {"colName": "empID", "colType": "String"  },
        {"colName": "empName", "colType": "String"},
        {"colName": "deptID", "colType": "String"},
    ],
    "message": "Success",
    "status": 200
}                                          
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax.
                                                
{
    "token": <"connection-token">, 
    "cmd": "GET_NON_INDEXED_COL",
    "dbName": <"database-name">,
    "rel": <"relation-name">
}
                                                
                                            
                                                
{
    "token": "2134770734|1905622745408421709|2134771389",
    "cmd": "GET_NON_INDEXED_COL",
    "dbName": "databaseName",
    "rel": "relationName"
} 
                                                
                                            
                                                
{
    "data": [
       {"colName":"is_permanent_employee","colType":"Boolean"}
    ],
    "message": "Success",
    "status": 200
}                                    
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax.
                                                
{
    "token": <"connection-token">, 
    "cmd": "GET_ALL_COL",
    "dbName": <"database-name">,
    "rel": <"relation-name">
}
                                                
                                            
                                                
Using Javascript? Include following Javascript file to easily create the GET_ALL_COL request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create GET_ALL_COL request is - createGETALLCOLRequest(token, dbName, relName);
                                                
                                            
                                                
{
    "token": "2134770734|1905622745408421709|2134771389",
    "cmd": "GET_ALL_COL",
    "dbName": "databaseName",
    "rel": "relationName"
}

 
                                                
                                            
                                                
{
    "data": [
        {"colName": "empAllowance", "colType": "Double" },
        {"colName": "empBasic", "colType": "Long" },
        {"colName": "empDed", "colType": "Double" },
        {"colName": "empDsg", "colType": "String" },
        {"colName": "empID", "colType": "String"  },
        {"colName": "empName", "colType": "String"},
        {"colName": "deptID", "colType": "String"},
    ],
    "message": "Success",
    "status": 200
}                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax.
                                                
{
    "token": <"connection-token">, 
    "cmd": "IS_COLUMN_INDEXED",
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    "colName": <"column-name">
}
                                                
                                            
                                                
{
    "token": "-1167378241|1086969150968262306|-1167383633",
    "cmd": "IS_COLUMN_INDEXED",
    "dbName": "databaseName",
    "rel": "relationName",
    "colName": "empAllowance"
}



 
                                                
                                            
                                                
{
    "data": "true",
    "message": "Success",
    "status": 200
}                               
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or non index column.
                                                
{
    "token": <"connection-token">, 
    "cmd": "IS_COLUMN_EXIST",
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    "colName": <"column-name">
}
                                                
                                            
                                                
Using Javascript? Include following Javascript file to easily create the IS_COLUMN_EXIST request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create IS_COLUMN_EXIST request is - createIS_COLUMN_EXISTRequest(token, dbname, relationName, colName);
                                                
                                            
                                                
{
    "token": "-1167378241|1086969150968262306|-1167383633",
    "cmd": "IS_COLUMN_EXIST",
    "dbName": "databaseName",
    "rel": "relationName",
    "colName": "empBasic"
}

 
                                                
                                            
                                                
{
    "data": "true",
    "message": "Success",
    "status": 200
}                              
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or COLUMN DOES NOT EXIST.
                                                
{
    "token": <"connection-token">, 
    "cmd": "IS_RELATION_EXISTS",
    "dbName": <"database-name">,
    "rel": <"relation-name">
}
                                                
                                            
 IS_RELATION_EXISTS check only one relation at a time in database.
                                                
{
    "token":"608862677|6881615657484689906|608862671",
    "cmd": "IS_RELATION_EXISTS",
    "dbName": "Employee-DB",
    "rel":"Admin-User"
}


 
                                                
                                            
                                                
{
    "data": "true",
    "message": "Success",
    "status": 200
}                              
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or RELATION DOES NOT EXIST.
                                                
{
    "token": <"connection-token">, 
    "cmd": "IS_DATABASE_EXISTS",
    "dbName": <"database-name">,
}
                                                
                                            
 IS_DATABASE_EXISTS check only one database at a time.
                                                
{
    "token":"608862677|6881615657484689906|608862671",
    "cmd": "IS_DATABASE_EXISTS",
    "dbName": "Employee-DB",
}



 
                                                
                                            
                                                
{
    "data": "true",
    "message": "Success",
    "status": 200
}                              
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or DATABASE DOES NOT EXIST.
                                                
{
    "token": <"connection-token">, 
    "cmd": "SYNC_DB",
    "dbName": <"database-name">,
    "relTsJson":  {
    <"rel1">:<time-stamp1> <<,<"rel2">:<time-stamp2> >>...
    },
    <<"createTime": <boolean-value>,>>
    <<"updateTime": <boolean-value> >>
        
} 
                                                
                                            
                                                
Using Javascript? Include following Javascript file to easily create the SYNC_DB request. 
src="https://login2explore.com/jpdb/resources/js/0.0.4/jpdb-commons.js"
Method to create SYNC_DB request is - createSYNC_DBRequest(token, dbName, relTimestampObjStr, createTime, updateTime);
                                                
                                            
                                                
{
    "token": "608862679|6881615563234464505|608862542",
    "dbName": "INDORE-TERAPANTH-DIRECTORY",
    "cmd": "SYNC_DB",
    "relTsJson": {
        "DONATION": 0
    },
    "createTime": true,
    "updateTime": true
}
                                                
                                            
                                                
{
    "data": [{
            "record_count": 2,
            "relName": "DONATION",
            "rel_timestamp": 1573124918795,
            "delete_count": 0,
            "json_records": [{
                    "rec_no": 1,
                    "created": 1573124918794,
                    "record": {
                        "miCode": "f02d",
                        "donationName": "Directory",
                        "visibility": "show",
                        "content": "TYP presents the FIRST ever digital directory for Indore Terapanth samaaj",
                        "url": "https:\/\/p-y.tm\/M04K-3Z"
                    },
                    "updated": 1573124918794
                }, {
                    "rec_no": 2,
                    "created": 1573124918795,
                    "record": {
                        "miCode": "f4b9",
                        "donationName": "2021",
                        "visibility": "show",
                        "content": "Acharya Shree Mahapragya Ji ka Indore Agaman.",
                        "url": "https:\/\/p-y.tm\/M04K-3Z"
                    },
                    "updated": 1573124918795
                }]
        }],
    "message": "DATA RETRIEVED FROM PI",
    "status": 200
}
                                               
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or relation does not exist.

# IDL (JPDB Index Definition Language) - To add index column and remove column / relation / database.

Http method : POST
Base url : http://api.login2explore.com:5577
End-point url : /api/idl
                                                
{
    "token": <"connection-token">, 
    "cmd": "INDEX_COLUMN",
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    "jsonStr": {
        <"column-name-1":"dummy-value-type-1",...>
    }
} 
                                                
                                            
                                                
{
    "token": "2134770734|1905622745408438787|2134771388",
    "cmd": "INDEX_COLUMN",
    "dbName": "Company",
    "rel": "Employee",
    "jsonStr": {
        "empName": "Arpit",
        "empSalary": 25000
    }
}
                                                
                                            
                                                
{
    "data": {
        "empName": "Arpit"
    },
    "message": "COLUMN ADDED TO PI",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or column already indexed / column does not exist.
                                                
{
    "token": <"connection-token">, 
    "cmd": "UNINDEX_COLUMN",
    "dbName": <"database-name">,
    "rel": <"relation-name">,
    "jsonStr": {
        <"column-name-1":"dummy-value-type-1",...>
    }
} 
                                                
                                            
                                                
{
    "token": "2134770734|1905622745408438787|2134771388",
    "cmd": "UNINDEX_COLUMN",
    "dbName": "Company",
    "rel": "Employee",
    "jsonStr": {
        "empName": "Arpit",
        "empSalary": 25000
    }
}
                                                
                                            
                                                
{
    "data": {
        "empName": "Arpit"
    },
    "message": "COLUMN IS NOW UNINDEXED",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or column does not exist.
                                                
{
    "token": <"connection-token">, 
    "cmd": "REMOVE_RELATION",
    "dbName": <"database-name">,
    "rel": <"relation-name">
} 
                                                
                                            
                                                
{
    "token": "2134770734|1905622745408438787|2134771388",
    "cmd": "REMOVE_RELATION",
    "dbName": "Company",
    "rel": "Employee"
}
                                                
                                            
                                                
{
    "data": "",
    "message": "RELATION REMOVED FROM PI",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or relation / database does not exist.
                                                
{
    "token": <"connection-token">, 
    "cmd": "REMOVE_DB",
    "dbName": <"database-name">
} 
                                                
                                            
                                                
{
    "token": "2134770734|1905622745408438787|2134771388",
    "cmd": "REMOVE_DB",
    "dbName": "Company"
}
                                                
                                            
                                                
{
    "data": "Comapny",
    "message": "DATABASE REMOVED",
    "status": 200
}
                                                
                                            
200 for success
401 for error, error due to Invalid Token.
400 for error, error can be due to syntax or database does not exist.