Closed phated closed 4 years ago
I'm not sure what you mean here. We shouldn't be doing any converting at all, and only returning buffers or strings depending on what levelup asks for.. Can you give me a code example of what you expect and what you're actually getting?
Sorry for being unclear. I am specifying content_type
as 'application/json'
but the values of each sibling is a buffer. Based on the documentation, I assumed they would be objects before reaching my sibling resolver. I thought this was related to https://github.com/nlf/riakdown/blob/master/index.js#L68-L70 only handling the length of 1.
Ah, I see what you mean. No, the issue here is actually that levelup is doing the conversions for us. You can see here that we set parse_values
to false
which prevents riakpbc from doing any conversions. This was to make sure that levelup works correctly.
I see what you mean with the siblings though, it would be helpful to parse them for you before presenting them to the resolver as well as converting the result back to a buffer or string transparently. I'll see if I can work something out.
Thanks! I ended up putting the logic in my resolver for the time being.
It seems to only convert the type when you get 1 result back, not when siblings are returned.