Module: lib/datastores/mongodb

Module to use mongodb as a datastore

Source:
Tutorials:

Methods

(inner) closeDatastore(callback)

Closes the database

Parameters:
Name Type Description
callback datastoreCloseCb

function to be 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 to be called after retrieving Whiteflag messages

Source:

(inner) getState(callback)

Gets Whiteflag state from the database

Parameters:
Name Type Description
callback datastoreGetStateCb

function to be 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 to be called after initialising the datastore

Source:

(inner) storeMessage(wfMessage, callback)

Stores a Whiteflag message in the database

Parameters:
Name Type Description
wfMessage wfMessage

the whiteflag message to be stored

callback datastoreStoreMessageCb

function to be 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 to be called after storing the Whiteflag state

Source: