Members
Methods
# static exports.getDefinitions(loadJSON, collection)
Returns the definition array associated with collectionName in the loadJSON structure, or an empty array if none was found.
Parameters:
Name | Type | Description |
---|---|---|
loadJSON |
The load file contents. |
|
collection |
The collection of interest. |
# static exports.loadCollection(collection, loadJSON, consolep)
Given a collection and the loadJSON structure, looks up the definitions and invokes define() on them.
Parameters:
Name | Type | Description |
---|---|---|
collection |
The collection to be loadd. |
|
loadJSON |
The structure containing all of the definitions. |
|
consolep |
output console.log message if truey. |
# static getRestoreFileAge(loadFileName) → {String}
Returns a string indicating how long ago the load file was created. Parses the file name string.
Parameters:
Name | Type | Description |
---|---|---|
loadFileName |
The file name. |
A string indicating how long ago the file was created.
# static loadDatabase()
If the database is empty, this function looks up the name of the load file in the settings file, and if it is specified, then it reads it in and calls define() on its contents in order to load the database. Console messages are generated when the contents of the load file does not include collections that this function assumes are present. Conversely, if the load file contains collections not processed with this file, a string is also printed out.