class DatabaseObject - nsc-de/js-database GitHub Wiki

Overview

fields functions
#data #set()
#length #setDefault()
#setDefaults()
#get()
#getNormal()
#update()
#contains()

Fields

data

(get & set) The data of the DatabaseObject

length

(get) Returns the size of the DatabaseObject


Functions

set()

Sets a value from the DatabaseObject

parameters
key the path to apply the value to
value the value to apply to the given path

returns the DatabaseArray itself, so you can chain operations like that



setDefault()

Sets a default value from the DatabaseObject

parameters
key the path to apply the value to
value the value to apply to the given path

returns the DatabaseArray itself, so you can chain operations like that


setDefaults()

Sets default values for the DatabaseObject

parameters
defaults an object containing all the default values

returns the DatabaseArray itself, so you can chain operations like that


get()

Gets a value from the DatabaseObject

parameters
key the path to apply the value to

returns the value of the key


getNormal()

Gets a value from the DatabaseObject normalizes it

parameters
key the path to apply the value to

returns the normalized value of the key


update()

Upates a value from the DatabaseObject

parameters
key the path to apply the value to
update the funciton to update the value

returns the DatabaseArray itself, so you can chain operations like that


contains()

Checks if the DatabaseObject contains a value

parameters
key the path to apply the value to

returns does the array contains the value


⚠️ **GitHub.com Fallback** ⚠️