Closed Mwexim closed 4 years ago
You can save objects by using the json encoding:
const level = require('level')
const db = level('my-db', { valueEncoding: 'json' })
await db.put('test', { foo: 123 })
Now I have a problem with the streams: when I do createValueStream().on('data', data => console.log(data)), it logs 'null', but when I get it with the get() method, it works. .
Can you share a complete code example?
When you want to save classes to a level storage, it simply doesn't save.
Maybe you can apply a fix for this/another solution?
And if this is valid, maybe state it on the main page?
To reproduce:
When you'd get all the values in the storage, it will only get the second one, the first one isn't even added.
Maybe I'm wrong...