You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm really struggling trying to understand the examples in the readme and elsewhere when trying to read a file. I have a JSON file and I am trying to load and read from. For example:
import { Low } from 'lowdb'
import { JSONFile } from 'lowdb/node'
const adapter = new JSONFile('file.json')
const db = new Low(adapter)
await db.read()
console.log(db.data)
Whatever variation I try, it keeps saying I am missing the default data. The example in the readme to read or create a file includes the default data, which doesn't make any sense to me because it is just an empty object and when I try that, I get an empty database instead of the data from my file. I really don't understand how this is supposed to work.
The text was updated successfully, but these errors were encountered:
I'm really struggling trying to understand the examples in the readme and elsewhere when trying to read a file. I have a JSON file and I am trying to load and read from. For example:
Whatever variation I try, it keeps saying I am missing the default data. The example in the readme to read or create a file includes the default data, which doesn't make any sense to me because it is just an empty object and when I try that, I get an empty database instead of the data from my file. I really don't understand how this is supposed to work.
The text was updated successfully, but these errors were encountered: