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
user:9: Tom
user:8: Tom
user:7: Tom
user:6: Tom
user:5: Tom
user:4: Tom
user:3: Tom
user:2: Tom
user:15: Tom
user:14: Tom
user:13: Tom
user:12: Tom
user:11: Tom
user:10: Tom
user:1: Tom
is that correct behavior?
The text was updated successfully, but these errors were encountered:
The "user:1" is ordered ahead of "user:10" when ascending and ordered behind when descending. This is because the keys in buntdb are in lexicographical order.
A popular option to keep order is to pad the numbers with zeros so that every number is of equal length. user:1 becomes user:0000000001
Makes sure, however, that the length of padded numbers remain the same for all keys.
@jekabolt recently faced a similar problem
Try this project https://github.com/gebv/lex. It is fork. Added go mod and minor code fixes.
It is project looks complete. Maybe as part of other projects (sub packages) there is something more complete.
output
is that correct behavior?
The text was updated successfully, but these errors were encountered: