Skip to content

Commit 1d3fb18

Browse files
authored
Fix example of tuple field path (#3144)
Fixes #2323
1 parent 55a6ced commit 1d3fb18

File tree

1 file changed

+6
-12
lines changed

1 file changed

+6
-12
lines changed

doc/reference/reference_lua/box_tuple/field_path.rst

Lines changed: 6 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ tuple_object[field-path]
3030

3131
In the following example, a tuple named ``t`` is returned from ``replace``
3232
and then only the relevant part (in this case, matching a name)
33-
of a relevant field is returned. Namely: the second field, the
34-
sixth part, the value following 'value='.
33+
of a relevant field is returned. Namely: the second field, its
34+
third item, the value following 'key='.
3535

3636
.. code-block:: tarantoolsession
3737
@@ -44,25 +44,19 @@ tuple_object[field-path]
4444
tarantool> format[2] = {name = 'field2', type = 'array'}
4545
---
4646
...
47-
tarantool> format[3] = {name = 'field4', type = 'string' }
48-
---
49-
...
50-
tarantool> format[4] = {name = "[2][6]['пw']['Я']", type = 'string'}
51-
---
52-
...
5347
tarantool> s = box.schema.space.create('test', {format = format})
5448
---
5549
...
5650
tarantool> pk = s:create_index('pk')
5751
---
5852
...
59-
tarantool> field2 = {1, 2, 3, "4", {5,6,7}, {пw={Я="п"}, key="V!", value="K!"}}
53+
tarantool> field2_value = {1, "ABC", {key="Hello", value="world"}}
6054
---
6155
...
62-
tarantool> t = s:replace{1, field2, "123456", "Not K!"}
56+
tarantool> t = s:replace{1, field2_value}
6357
---
6458
...
65-
tarantool> t["[2][6]['value']"]
59+
tarantool> t["[2][3]['key']"]
6660
---
67-
- K!
61+
- Hello
6862
...

0 commit comments

Comments
 (0)