OpenVeo Core server

API Docs for: 7.0.0
Show:

SettingProvider

Extends EntityProvider
Module: core-providers

Summary

Defines a SettingProvider to get and save settings.

Constructor

SettingProvider

Syntax

SettingProvider

(
  • database
)

Summary

Parameters:

  • database Database

    The database to interact with

Item Index

Methods

add

Syntax

add

(
  • settings
  • [callback]
)
async

Summary

Adds settings.

If a setting already exists, an update is performed.

Parameters:

  • settings Array

    The list of settings to store with for each setting:

    • String id The setting key
    • Mixed value The setting value
  • [callback] Function optional

    The 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

(
  • callback
)
async

Summary

Creates users indexes.

Parameters:

  • callback Function

    Function to call when it's done with :

    • Error An error if something went wrong, null otherwise

updateOne

Syntax

updateOne

(
  • [filter]
  • data
  • [callback]
)
async

Summary

Updates a setting.

Parameters:

  • [filter] ResourceFilter optional

    Rules to filter the setting to update

  • data Object

    The modifications to perform

    • value Mixed

      The setting value

  • [callback] Function optional

    The function to call when it's done

    • Error The error if an error occurred, null otherwise
    • Number 1 if everything went fine