Asynchronous database.
Categories > Data structure > rex_nedbIntroductionLinksDependenceUsageStorage typeWriteInsert rows by CSVData typeInsert rows by JSONSave rowUpdate rowsRemoveReadRead all rowsQueryingRead all queried rowsRetrieve queried rowsDatabase referenceSave & loadDebug panel
None
Persistence : store database in disk
Set property Storage to Disk. and
Set Database name to a non-empty string
Database name is "", an empty string.In memory : store database in memory
Storage to In memory.Action:Insert CSV data
Callback
Trigger Condition:On update, or
Trigger Condition:On update error
`Expression:LastErrorMessageProperty Eval mode
No : string
Action:Define type : define a column to be number type (Sample capx)Yes : parse value by eval function of javascrpt
10'hi'Math.random()For example,
xxxxxxxxxxName,HP,MP'aaa',100,20'bbb',80,30will insert 2 rows.
Error message will display on console when eval failed.
Action:Insert JSON data
Callback
Trigger Condition:On update, or
Trigger Condition:On update error
Expression:LastErrorMessageprepare row
Save data at a specific row, i.e. pick row then update it
Action:Set row ID, or Action:Set row index
Action:Set value , to set value of index key
Index keys : a set of keys which the values are unique.
Index keys, or Action:Set index keys. ,, for example xxxxxxxxxxUID,VarNameOther keys
Action:Set value
if greater , if lessAction:Set boolean value
Action:Set JSON
Action:Add to
Action:Save
Expression:LastSavedRowID
Pick row by rowID
Else
Pick row by index keys
Callback
Trigger Condition:On update, or
Trigger Condition:On update error
Expression:LastErrorMessageBuild filter and prepare row
Build filter
Action:1. NewAction:2. value comparePrepare row
Action:Update queried rows
Callback
Trigger Condition:On update, or
Trigger Condition:On update error
Expression:LastErrorMessageremove rows
Action:Remove by row IDAction:Remove allAction:Remove queried rowsAction:Remove by row indexCallback
Trigger Condition:On remove rows, or
Trigger Condition:On remove rows error
Expression:LastErrorMessageExpression:AllRowsAsJSON, all rows in JSON stringExpression:AllRowsCountCreate a new filter, or start from current filter (sample capx), if it does not create a new filter.
Action:1. NewAdd conditions, or get all row, if no conditions assigned.
Action:2. value compareAction:2. boolean value compareAction:2. regex matchedsort
Action:3. order, or Condition:3. orderLoad
Action:Load queried rowsCallback
Trigger Condition:On load rows, or
Trigger Condition:On load rows error
`Expression:LastErrorMessageExpression:QueriedRowsAsJSON, all queried rows in JSON stringExpression:QueriedRowsCountExpression:QueriedSum( key )Expression:QueriedMin( key )Expression:QueriedMax( key )Condition:For each row
Expression:CurRowContent
Expression:CurRowContent, returns key-value pairs of current row in JSON stringExpression:CurRowContent( key ), returns the value of a specific key, or 0 if the key does not existExpression:CurRowContent( key, defaultValue ), returns the value of a specific key, or defaultValue if the key does not exist.Expression:CurRowIndex
Get queried row by index from 0 to Expression:QueriedRowsCount-1 (sample capx)
Expression:Index2QueriedRowContent( index ), returns key-value pairs of the specific row in JSON string
Expression:Index2QueriedRowContent( index, key ), returns the value of a specific key, or 0 if the key does not exist
Expression:Index2QueriedRowID( index ), returns rowID of the specific rowExpression:Index2QueriedRowContent( index, key, defaultValue ), returns the value of a specific key, or defaultValue if the key does not exist.
Property Database name
Empty string "" : private database, destroyed when instance had been destroyed
Not empty string : a global database indexed by this Database name property
It supports official saving & loading feature when using Disk storage mode, queried rows will also be saved.
All rows will be shown at debug panel in JSON format.