ODFormattedJsonDatabase 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 Formatted 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!
This one is exactly the same as ODJsonDatabase, but it has a formatter from the formatted-json-stringify package.
This can help you organise it a little bit better!
Properties
inherited file string ➜ string
The name of the file with extension.
formatter type ➜ formatted-json-stringify.ArrayFormatter
The formatter to use on the database array
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.ODFormattedJsonDatabase
(no description)
View Parameters (4)
id: type ➜api.ODValidId- Parameter Description Lorem Ipsum.file: string ➜string- Parameter Description Lorem Ipsum.formatter: type ➜formatted-json-stringify.ArrayFormatter- 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!