Learn more about the default database for prototyping with Jovo: A file based system that stores user specific data to a JSON file.
Note: This database type is not supposed to be used in production. See other database integrations for options when the app is live.
The FileDB integration allows you to easily store user session data in a JSON file. This is especially helpful for local development and prototyping. Data will be stored to a
db.json file that can be found in a
This is an example how the file structure looks like, with the
userID as a mainKey and some persisted data with
someValue, which can be added with
this.$user.$data.someKey = 'someValue';:
Most Jovo templates come with FileDB as default database integration.
It can be enabled in the
src/app.js file like this:
config.js file, you can set the
db configuration like this:
Once the configuration is done, the File DB database integration will create a file in the specified folder (eg.
../db/db.json) on the first read/write attempt. No need for you to create the file.