JDB Usage documentation
with JDB Node containers
Current node rules
- All keys in the same node must be of the same type (either numbers or strings)
- All values in the same node must be of the same type (child nodes or data nodes)
- Key numbers cannot be zero. Key strings cannot be empty.
- Keys within the same node can only have 1 value
Authentication
Authentication can be done in using the following methods with JID as backend
- HTTP basic
- HTTP digest
- Web form / user interaction
- SSO / session cookies
HTTP commands
- GET - Retrieve data
- POST - Insert
- PUT - Replace / Set
- PATCH - Update if exists
- DELETE - Delete
- MKCOL - Create/delete database
Inserting data - POST, PUT and PATCH
When inserting data, the HTTP body is the value to be inserted.
If the HTTP body is gzip encoded, JDB will store the data as gzip compressed.
You can also request that JDB compresses an un-compressed body using ?compress parameter.
The Content-Type used in the insertion will be stored by JDB and returned in a GET request later.
Example: POST /db/232/933/image.svg?compress
Retrieving single entry - GET
When retrieving data, the HTTP response contains the data which was requested.
You can request the data to be compressed in gzip, base64, base64url or not to be compressed using the Accept-Encoding HTTP header.
HTTP Range is supported
Example: GET /db/232/933/image.svg
Retrieving multiple entries - GET
If you request a URI which is not a single entry, you will receive all entries encoded as either JSON or JDB binary depending on your Accept-Encoding.
If you stored JSON-data in a value, JDB support returning it as a part of a multi-retrieve without double-encoding the individual JSON response data.
Example: GET /db/232/
Returned data can be:
{
933: { raw json or other type of data }
, 12344: { raw json or other type of data }
}