SettingProvider
Summary
Defines a SettingProvider to get and save settings.
Constructor
SettingProvider
Syntax
SettingProvider
(
-
database
Summary
Parameters:
-
database
DatabaseThe database to interact with
Item Index
Methods
Methods
add
Syntax
add
(
async
-
settings
-
[callback]
Summary
Adds settings.
If a setting already exists, an update is performed.
Parameters:
-
settings
ArrayThe list of settings to store with for each setting:
- String id The setting key
- Mixed value The setting value
-
[callback]
Function optionalThe function to call when it's done
- Error The error if an error occurred, null otherwise
- Number The total amount of settings inserted / updated
- Array The list of added / updated settings
createIndexes
Syntax
createIndexes
(
async
-
callback
Summary
Creates users indexes.
Parameters:
-
callback
FunctionFunction to call when it's done with :
- Error An error if something went wrong, null otherwise
updateOne
Syntax
updateOne
(
async
-
[filter]
-
data
-
[callback]
Summary
Updates a setting.