Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Decoder Err ! #92

Closed
giveerr opened this issue Jun 6, 2020 · 3 comments
Closed

Decoder Err ! #92

giveerr opened this issue Jun 6, 2020 · 3 comments
Labels
question Support or open question(s)

Comments

@giveerr
Copy link

giveerr commented Jun 6, 2020

i have some code that uses multileveldown with charwise. when i try to keyStream in parent of db ( have created with subleveldown ) that cause err like this

events.js:298 throw er; // Unhandled 'error' event ^ Error [EncodingError]: no decoder for:"!users!!base!1"

i want to handle the main data in the parent db not the subdb's is there any way to do it ?

@vweevers
Copy link
Member

vweevers commented Jun 7, 2020

I suppose you could do db.createKeyStream({ keyEncoding: 'utf8' }) and then parse the keys yourself: strip subleveldown's prefixes and do charwise.decode(key).

@vweevers vweevers added the question Support or open question(s) label Jun 7, 2020
@giveerr
Copy link
Author

giveerr commented Jun 7, 2020

@vweevers
that works but actualy i think its not the best way because it will read all of it and send to client . is there another way to do this ??

@vweevers
Copy link
Member

It's hard to see what you want to achieve and why. If you're using sublevels and one of the sublevels has a special encoding, then you'll want to access the data via that sublevel. If that's not possible then I would ask, is using a sublevel the right choice?

@giveerr giveerr closed this as completed Jul 14, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Support or open question(s)
Projects
None yet
Development

No branches or pull requests

2 participants