Skip to content

Commit 94b40d8

Browse files
authored
Adds new methods to index_object_parts (#5140)
* Since 3.1.0 4 new ```key_def``` methods are applicable to ```index_object.parts``` * ```validate_key()``` * ```validate_full_key``` * ```validate_tuple()``` * ```compare_keys()``` * Functionally methods are equivalent to their description in ```key_def``` * Fixes #5139 * Fixes syntax
1 parent 5616c49 commit 94b40d8

File tree

1 file changed

+17
-11
lines changed
  • doc/reference/reference_lua/box_index

1 file changed

+17
-11
lines changed

doc/reference/reference_lua/box_index/parts.rst

Lines changed: 17 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,31 @@ index_object.parts
1515
:ref:`compare_with_key() <key_def-compare_with_key>`,
1616
:ref:`merge() <key_def-merge>`.
1717

18+
Since version :doc:`3.1.0 </release/3.1.0>`, the ``index_object.parts`` can operate methods
19+
:ref:`validate_key() <key_validate_key>`,
20+
:ref:`validate_full_key() <key_validate_full_key>`,
21+
:ref:`validate_tuple() <key_validate_tuple>`,
22+
:ref:`compare_keys() <key_compare_keys>`.
23+
1824
**``index_object.parts`` example**
1925

2026
.. code-block:: lua
2127
22-
box.schema.space.create('T')
23-
i = box.space.T:create_index('I', {parts={3, 'string', 1, 'unsigned'}})
24-
box.space.T:insert{1, 99.5, 'X', nil, 99.5}
25-
i.parts:extract_key(box.space.T:get({'X', 1}))
28+
box.schema.space.create('T')
29+
i = box.space.T:create_index('I', {parts={3, 'string', 1, 'unsigned'}})
30+
box.space.T:insert{1, 99.5, 'X', nil, 99.5}
31+
i.parts:extract_key(box.space.T:get({'X', 1}))
2632
2733
**``key_def`` equivalent**
2834

29-
.. code-block:: lua
35+
.. code-block:: lua
3036
31-
key_def = require('key_def')
32-
box.schema.space.create('T')
33-
i = box.space.T:create_index('I', {parts={3, 'string', 1, 'unsigned'}})
34-
box.space.T:insert{1, 99.5, 'X', nil, 99.5}
35-
k = key_def.new(i.parts)
36-
k:extract_key(box.space.T:get({'X', 1}))
37+
key_def = require('key_def')
38+
box.schema.space.create('T')
39+
i = box.space.T:create_index('I', {parts={3, 'string', 1, 'unsigned'}})
40+
box.space.T:insert{1, 99.5, 'X', nil, 99.5}
41+
k = key_def.new(i.parts)
42+
k:extract_key(box.space.T:get({'X', 1}))
3743
3844
The outcome of the methods calling is described in :ref:`key_def_object <key_def_object>`.
3945

0 commit comments

Comments
 (0)