Skip to content

Commit aa3ed3c

Browse files
committed
fixes gh-1737 describe the new way to write 'parts' option while creating indexes
1 parent 44e58dd commit aa3ed3c

File tree

2 files changed

+17
-1
lines changed

2 files changed

+17
-1
lines changed

doc/reference/reference_lua/box_space/create_index.rst

Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -152,6 +152,21 @@ On this page:
152152
name: primary
153153
...
154154
155+
.. NOTE::
156+
157+
Since version :doc:`2.7.1 </release/2.7.1>` it is allowed to omit
158+
extra braces in index definition if it consists of only one part.
159+
160+
.. code-block:: lua
161+
162+
--old way with extra braces (still correct)
163+
my_space:create_index('one_part_idx', {parts = {{1, 'unsigned'}}})
164+
165+
--new way
166+
my_space:create_index('one_part_idx', {parts = {1, 'unsigned'}})
167+
168+
169+
155170
.. _details_about_index_field_types:
156171

157172
.. _box_space-index_field_types:

doc/release/2.7.1.rst

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,8 @@ Core
3939
~~~~
4040

4141
- Now it is allowed to define an index without extra braces when there
42-
is only one part: ``parts = {field1, type1, ...}`` (gh-2866).
42+
is only one part: ``parts = {field1, type1, ...}`` (gh-2866). Read more in
43+
the note after the example in :doc:`/reference/reference_lua/box_space/create_index`.
4344
- Bitset index now supports the varbinary type (gh-5392).
4445
- Index-related options now can’t be specified in their definition due
4546
to a more pedantic key-parts verification (gh-5473).

0 commit comments

Comments
 (0)