JVM library for jsonbox.io: A HTTP based JSON storage. It lets you store, read & modify JSON data over HTTP APIs for FREE. Ideal for small projects, prototypes or hackathons, where you don't have to spin up your own data store.
Demo example:
JsonBoxStorage storage = new JsonBoxStorage("box30c83d77bab82ce487665");
// create a new record
storage.create(adapter.toJson(new Record("john")));
// read records
List<Record> records = adapter.fromJson(storage.read());
Name | Summary |
---|---|
JsonBoxStorage() |
Instance for a jsonbox.io box, a random box id will be generated, you can use getBoxId() to retrieve the generated box id |
JsonBoxStorage(String boxId) |
Instance for a jsonbox.io box |
JsonBoxStorage(String boxId, String collectionId) |
Instance for a jsonbox.io collection inside a box |
Name | Summary |
---|---|
create(String json) |
Create a new record |
read() |
Read all records |
read(int skip, int limit, String filter, String sort) |
Read records with pagination, filtering and sorting* |
update(String recordId, String json) |
Update a record by a given record id |
delete(String recordId) |
Delete a single record by a given record id |
deleteFiltering(String filter) |
Delete multiple records using filtering* |
*filtering and sorting:
filter
usage heresort
by a json property, use-
for descending sorting, example:"-name"
.
Name | Summary |
---|---|
getBoxId() |
current box id |
getCollectionId() |
current collection id (returns null if you are not using a collection) |
Name | Summary |
---|---|
readFiltering(String filter) |
Read applying only filtering |
readSorting(String sort) |
Read applying only sorting |
read(int skip, int limit) |
Read applying only pagination** |
read(int skip, int limit, String filter) |
Read applying only pagination and filtering** |
**default sorting is _createdOn
desc.
Feel free to contribute. Just create an issue before sending a Pull Request.