-
Notifications
You must be signed in to change notification settings - Fork 1.2k
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
Iterating in reverse Order - Empty Content #347
Comments
When you seek for a key in reverse iterator, we find first key which is less than or equal to the seek key.
If you want all values for that prefix in reverse mode you should seek for |
Just be careful of the case where you have keys of the form When seeking to the initial iterator position, it would be more correct to seek to the prefix but with the last byte incremented. So if your prefix is |
This whole thing seems a bit tricky for users to get right. Maybe we need a |
Wow, I just missed the whole context. Isn't reverse suppose to iterate the value for key I tried, prefixing
|
Just right out of bat, I find this strange:
Reusing an internal byte slice from item would cause weird issues -- and the one you're seeing might be related. So, fix that, and then re-run the iterator. Also, have a look at the tests which do reverse iteration, and see how they achieve the same results. |
@manishrjain, Ok, the only other option I see is:-
But I read in FAQ https://github.com/dgraph-io/badger#frequently-asked-questions, where it says, If writes are getting stuck, then it's better to use Is there any other hack around available where reuse can be fixed. Update: Even after using |
The new Thanks |
I am trying to Iterate in Reverse Order, but every time, I set
Reverse
totrue
. It gives empty value.Below is code -
The text was updated successfully, but these errors were encountered: