Module to use mongodb as a datastore
- Source:
- Tutorials:
Methods
(inner) closeDatastore(callback)
Closes the database
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
datastoreCloseCb | function called after initialising the datastore |
- Source:
(inner) getMessages(wfQuery, callback)
Gets all Whiteflag messages from the database that match the query in an array
Parameters:
| Name | Type | Description |
|---|---|---|
wfQuery |
Object | the properties of the messages to look up |
callback |
datastoreGetMessagesCb | function called after retrieving Whiteflag messages |
- Source:
(inner) getState(callback)
Gets Whiteflag state from the database
Parameters:
| Name | Type | Description |
|---|---|---|
callback |
datastoreGetStateCb | function called after getting the Whiteflag state |
- Source:
(inner) initDatastore(dbConfig, callback)
Initialises the database
Parameters:
| Name | Type | Description |
|---|---|---|
dbConfig |
Object | datastore configuration parameters |
callback |
datastoreInitCb | function called after initialising the datastore |
- Source:
(inner) storeMessage(wfMessage, callback)
Stores a Whiteflag message in the database, preserving the transceive direction
Parameters:
| Name | Type | Description |
|---|---|---|
wfMessage |
wfMessage | the whiteflag message to be stored |
callback |
datastoreStoreMessageCb | function called after storing the Whiteflag message |
- Source:
(inner) storeState(stateObject, callback)
Stores Whiteflag state in the database
Parameters:
| Name | Type | Description |
|---|---|---|
stateObject |
Object | state data enclosed in a storage / encryption container |
callback |
datastoreStoreStateCb | function called after storing the Whiteflag state |
- Source: