Database
Represents the main database.
Properties
Property | Description |
collections | Array of the collections from the database |
version | The current version of the package |
Constructor
new Database(config)
Parameter | Default | Description |
config |
| Object (optional) The configuration to use in the database |
config.autoSave |
| Boolean (optional) Whether or not to write data into the JSON file everytime it is updated |
config.collectionsFolder |
| String (optional) The path to a folder where collections' data will be stored |
config.collectionTimestamps |
| Boolean (optional) Whether or not to automatically add the createdAt and updatedAt attributes to every collection entry |
config.dataFile |
| String (optional) The path to the JSON file (from the root of the project) where the main data will be stored |
config.encryptionKey |
| String (optional) The Encryption Key to use in encryption and decryption |
config.tabSize |
| Number (optional) The size of the tab in the JSON file (indentation) |
Last updated