ODJsonDatabase class
We are still working the API Reference! This page might be incomplete or doesn't contain all details!
Overview
This is an Open Ticket JSON database.
It stores data in a json file as a large Array using the category, key, value strategy.
You can store the following types: string, number, boolean, array, object & null!
You can use this class if you want to add your own database or to use an existing one!
Properties
inherited file string ➜ string
The name of the file with extension.
inherited id class ➜ api.ODId
The id of this data.
inherited path string ➜ string
The path to the file relative to the main directory.
Methods
constructor() function ➜ api.ODJsonDatabase
(no description)
View Parameters (3)
id: type ➜api.ODValidId- Parameter Description Lorem Ipsum.file: string ➜string- Parameter Description Lorem Ipsum.customPath: string ➜string- Parameter Description Lorem Ipsum.
inherited protected _change() function ➜ void
Trigger an onChange() event in the parent ODManager of this class.
inherited changed() function ➜ void
(❌ SYSTEM ONLY!!) Set the callback executed when a value inside this class changes.
delete() function ➜ api.ODOptionalPromise
Remove the value of category & key. Returns undefined when non-existent!
View Parameters (2)
exists() function ➜ api.ODOptionalPromise
Check if a value of category & key exists. Returns false when non-existent!
View Parameters (2)
get() function ➜ api.ODOptionalPromise
Get the value of category & key. Returns undefined when non-existent!
View Parameters (2)
getAll() function ➜ api.ODOptionalPromise
Get all values in category.
getCategory() function ➜ api.ODOptionalPromise
Get all values in category. Returns undefined when non-existent!
View Parameters (1)
category: string ➜string- Parameter Description Lorem Ipsum.
init() function ➜ api.ODPromiseVoid
Init the database.
set() function ➜ api.ODOptionalPromise
Set/overwrite the value of category & key. Returns true when overwritten!
View Parameters (3)
category: string ➜string- Parameter Description Lorem Ipsum.key: string ➜string- Parameter Description Lorem Ipsum.value: type ➜api.ODValidJsonType- Parameter Description Lorem Ipsum.
Defaults
We're still working on this part of the documentation!
Examples
We're still working on this part of the documentation!