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
Now there are two more iterators available: 'np' (next prefix)
and 'pp' (previous prefix). They work only in memtx tree. Also,
if the last part of key is not a string, they degrade to 'gt'
and 'lt' iterators.
These iterators introduce special comparison of the last part of
key (if it is a string). In terms of lua, if s is the search part,
and t is the corresponding tuple part, 'np' iterator searches for
the first tuple with string.sub(t, 1, #s) > s, while 'pp' searches
for the last tuple with string.sub(t, 1, #s) < s.
Comparison of all other parts of the key remains normal.
As usual, these iterators are available both in select and pairs,
in index and space methods.
Similar to all other tree iterators, they change only initial
search of selection. Once the first tuple found, the rest are
selected sequentially in direct (for 'np') or reverse (for 'pp')
order of the index.
Uh oh!
There was an error while loading. Please reload this page.
Related dev. issue(s): tarantool/tarantool#9994
Product: Tarantool
Since: 3.2
Root document: https://www.tarantool.io/en/doc/latest/reference/reference_lua/box_index/pairs/
SME: @ alyapunov
Details
Now there are two more iterators available: 'np' (next prefix)
and 'pp' (previous prefix). They work only in memtx tree. Also,
if the last part of key is not a string, they degrade to 'gt'
and 'lt' iterators.
These iterators introduce special comparison of the last part of
key (if it is a string). In terms of lua, if s is the search part,
and t is the corresponding tuple part, 'np' iterator searches for
the first tuple with string.sub(t, 1, #s) > s, while 'pp' searches
for the last tuple with string.sub(t, 1, #s) < s.
Comparison of all other parts of the key remains normal.
As usual, these iterators are available both in select and pairs,
in index and space methods.
Similar to all other tree iterators, they change only initial
search of selection. Once the first tuple found, the rest are
selected sequentially in direct (for 'np') or reverse (for 'pp')
order of the index.
For example:
Requested by @ alyapunov in tarantool/tarantool@96df090.
The text was updated successfully, but these errors were encountered: