@@ -1518,7 +1518,7 @@ Below is a list of all ``box.space`` functions and members.
1518
1518
1519
1519
.. _box_space-update :
1520
1520
1521
- .. method :: update(key, {{operator, field_no , value}, ...})
1521
+ .. method :: update(key, {{operator, field_identifier , value}, ...})
1522
1522
1523
1523
Update a tuple.
1524
1524
@@ -1527,7 +1527,7 @@ Below is a list of all ``box.space`` functions and members.
1527
1527
fragments of a field, deleting or inserting a field. Multiple
1528
1528
operations can be combined in a single update request, and in this
1529
1529
case they are performed atomically and sequentially. Each operation
1530
- requires specification of a field number. When multiple operations
1530
+ requires specification of a field identifier, which is usually a number. When multiple operations
1531
1531
are present, the field number for each operation is assumed to be
1532
1532
relative to the most recent state of the tuple, that is, as if all
1533
1533
previous operations in a multi-operation update have already been
@@ -1547,18 +1547,18 @@ Below is a list of all ``box.space`` functions and members.
1547
1547
* ``# `` for deletion
1548
1548
* ``= `` for assignment
1549
1549
1550
- For ``! `` and ``= `` operations the field number can be ``-1 ``, meaning
1551
- the last field in the tuple.
1550
+ Possible field_identifiers are:
1552
1551
1552
+ * Positive field number. The first field is 1, the second field is 2, and so on.
1553
+ * Negative field number. The last field is -1, the second-last field is -2, and so on. In other words: (#tuple + negative field number + 1).
1554
+ * Name. If the space was formatted with :ref: `space_object:format() <box_space-format >`, then this can be a string for the field 'name'.
1555
+
1553
1556
:param space_object space_object: an :ref: `object reference
1554
1557
<app_server-object_reference>`
1555
1558
:param scalar/table key: primary-key field values, must be passed as a
1556
1559
Lua table if key is multi-part
1557
1560
:param string operator: operation type represented in string
1558
- :param number field_no: what field the operation will apply to. The
1559
- field number can be negative, meaning the
1560
- position from the end of tuple.
1561
- (#tuple + negative field number + 1)
1561
+ :param number-or-string field_identifier: what field the operation will apply to.
1562
1562
:param lua_value value: what value will be applied
1563
1563
1564
1564
:return: the updated tuple.
@@ -1657,13 +1657,13 @@ Below is a list of all ``box.space`` functions and members.
1657
1657
1658
1658
.. _box_space-upsert :
1659
1659
1660
- .. method :: upsert({tuple}, {{operator, field_no , value}, ...}, )
1660
+ .. method :: upsert({tuple}, {{operator, field_identifier , value}, ...}, )
1661
1661
1662
1662
Update or insert a tuple.
1663
1663
1664
1664
If there is an existing tuple which matches the key fields of ``tuple ``, then the
1665
1665
request has the same effect as :ref: `space_object:update() <box_space-update >` and the
1666
- ``{{operator, field_no , value}, ...} `` parameter is used.
1666
+ ``{{operator, field_identifier , value}, ...} `` parameter is used.
1667
1667
If there is no existing tuple which matches the key fields of ``tuple ``, then the
1668
1668
request has the same effect as :ref: `space_object:insert() <box_space-insert >` and the
1669
1669
``{tuple} `` parameter is used. However, unlike ``insert `` or
@@ -1676,10 +1676,7 @@ Below is a list of all ``box.space`` functions and members.
1676
1676
:param table/tuple tuple: default tuple to be inserted, if analogue
1677
1677
isn't found
1678
1678
:param string operator: operation type represented in string
1679
- :param number field_no: what field the operation will apply to. The
1680
- field number can be negative, meaning the
1681
- position from the end of tuple.
1682
- (#tuple + negative field number + 1)
1679
+ :param number field_identifier: what field the operation will apply to
1683
1680
:param lua_value value: what value will be applied
1684
1681
1685
1682
:return: null
0 commit comments