KVDB Entries
Setting Entries in KVDB.
About Entries
The structure of an entry and a brief description of its elements is outlined in the following table:
| Field | Type | Encrypted | Description |
|---|---|---|---|
data | binary | yes | content of the entry |
info | ServerKvdbEntryInfo | no | additional information assigned by the server e.g. author, creationDate, key and kvdbID |
privateMeta | binary | yes | additional information about the entry |
publicMeta | binary | no | additional public information about the entry, also accessible through PrivMX Bridge API |
Define Structure
KVDB's architecture does not require you to use a specific data structure inside the entry. So before working with KVDBs, define what what kind of entries you want to send.
We recommend future-proofing your entries right from the start, i.e. choosing an easily modifiable format.
It is also a good idea to include its type and version in the structure of the entries.
Here is an example entries structure that you can use in your project.
Remember that it is only an example and you should consider your app's requirements and limitations.
Sample code on this page is based on the initial assumptions.
Creating KVDB Entry
When you create a new entry, the version parameter must be set to 0 - which is the default value.
Updating KVDB Entry
Depending on your project's specification, it may be necessary to modify an entry. It could be e.g. changing entry data, publicMeta, privateMeta. Each user with management rights is able to modify and delete entries.
Updating an entry means overwriting it with the provided data. To successfully update an entry, you must be entry creator or KVDB moderator.
If you want to update an existing KVDB entry - you have to provide current version of given entry. Even if certain fields haven’t changed, their current values must still be provided e.g. public and private meta.
Listing KVDB Entries
Define entry item class with decoded data and publicMeta:
Listing the most recent entries in given KVDB:
Checking if an Entry Exists
You can check if a KVDB entry with the given key exists within the specified KVDB instance.
Deleting KVDB Entries
The snippet below deletes KVDB entry and all its data. This action is irreversible.
We use cookies on our website. We use them to ensure proper functioning of the site and, if you agree, for purposes such as analytics, marketing, and targeting ads.
PrivMX Endpoint Java v2.6