Skip to content
Snippets Groups Projects
Commit cd247c19 authored by pcherenkov's avatar pcherenkov
Browse files

bug944126: documented insert/delete ops in UPDATE

parent 044a5e07
No related branches found
No related tags found
No related merge requests found
......@@ -262,8 +262,11 @@ Tarantool/Box IPROTO protocol.
<field_no> ::= <int32>
;
; 0 - assign operation argument to field <field_no>
; The rest of operations are only defined for 32-bit integer
; The operation(s) below operate on fields of arbitrary types:
; 0 - assign operation argument to field <field_no>;
; will extend the tuple if <field_no> == <max_field_no> + 1
;
; The following operation(s) are only defined for 32-bit integer
; types:
; 1 - add argument to field <field_no>, both arguments
; are treated as signed 32-bit ints
......@@ -273,8 +276,12 @@ Tarantool/Box IPROTO protocol.
; Tarantool 1.3.5 features one more command, which operates
; on strings:
; 5 - implementation of Perl 'splice' command
;
; The operation(s) below operate on fields of arbitrary types:
; 6 - delete <field_no>
; 7 - insert before <field_no>
<op_code> ::= <int8> # 0 | 1 | 2 | 3 | 4 | 5
<op_code> ::= <int8> # 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7
;
; It's an error to specify an argument of a type that
......
......@@ -346,6 +346,10 @@ localhost> lua box.select(5, 1, 'firstname', 'lastname')
<member><code>:p</code> &mdash; splice a
field: start at offset, cut length bytes, and add a
string.</member>
<member><code>#p</code> &mdash; delete a
field.</member>
<member><code>!p</code> &mdash; insert a field
(before the one specified).</member>
</simplelist>
Possible format specifiers are: <quote>+</quote>
for addition, <quote>-</quote> for subtraction,
......@@ -374,6 +378,14 @@ localhost> lua box.update(0, 0, '+p', 1, 1)
---
- 0: {2}
...
localhost> lua box.update(0, 2, '!p', 1, 'Bienvenue tout le monde!')
---
- 2: {'Bienvenue tout le monde!', 'Hello world!'}
...
localhost> lua box.update(0, 2, '#p', 2, 'Biennvenue tout le monde!')
---
- 2: {'Bienvenue tout le monde!'}
...
</programlisting>
</para>
</listitem>
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment