new LokiMemoryAdapter(optionsopt)
In in-memory persistence adapter for an in-memory database. This simple 'key/value' adapter is intended for unit testing and diagnostics.
Parameters:
Name | Type | Attributes | Description | |||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
options |
object |
<optional> |
memory adapter options Properties
|
Methods
deleteDatabase(dbname, callback)
Deletes a database from its in-memory store.
Parameters:
Name | Type | Description |
---|---|---|
dbname |
string | name of the database (filename/keyname) |
callback |
function | function to call when done |
loadDatabase(dbname, callback)
Loads a serialized database from its in-memory store. (Loki persistence adapter interface function)
Parameters:
Name | Type | Description |
---|---|---|
dbname |
string | name of the database (filename/keyname) |
callback |
function | adapter callback to return load result to caller |
saveDatabase(dbname, callback)
Saves a serialized database to its in-memory store. (Loki persistence adapter interface function)
Parameters:
Name | Type | Description |
---|---|---|
dbname |
string | name of the database (filename/keyname) |
callback |
function | adapter callback to return load result to caller |