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
when I store keys todo:0000000001 until todo:0000000010 (so 10 different records)
I see the order being right.
if I store todo:0000000001 again after that, the order is broken, because that last "record" is presented last, while the documentation states:
All keys/value pairs are ordered in the database by the key. To iterate over the keys:
save key: todo:0000000001
save key: todo:0000000002
save key: todo:0000000003
save key: todo:0000000004
save key: todo:0000000005
save key: todo:0000000006
save key: todo:0000000007
save key: todo:0000000008
save key: todo:0000000009
save key: todo:0000000010
save key: todo:0000000001
CreateIndex orders by the values, not the keys. buntdb.IndexString will order values by lexicographical order, where "2" > "10". buntdb.IndexInt will order values by numerical order, where "2" < "10".
when I store keys todo:0000000001 until todo:0000000010 (so 10 different records)
I see the order being right.
if I store todo:0000000001 again after that, the order is broken, because that last "record" is presented last, while the documentation states:
All keys/value pairs are ordered in the database by the key. To iterate over the keys:
Extra info: I have created an index on todo:
The insert goes like this:
Result:
I get all of my todos:
Result:
Am I doing something wrong?
I tried to do it with:
and that works. But how come the indexString doesn't work?
In my book the order should be the same because of the leading zeros, right?
The text was updated successfully, but these errors were encountered: