Skip to content
Snippets Groups Projects
Commit dd6ee696 authored by Konstantin Osipov's avatar Konstantin Osipov
Browse files

Correct an example in the user guide (box.update()).

Hat tip to Alexey Panfilov
parent 9b3ce491
No related branches found
No related tags found
No related merge requests found
...@@ -515,21 +515,17 @@ localhost> lua box.insert(0, 0, 'hello world') ...@@ -515,21 +515,17 @@ localhost> lua box.insert(0, 0, 'hello world')
... ...
localhost> lua box.update(0, 0, '+p', 1, 1) -- add value 1 to field #1 localhost> lua box.update(0, 0, '+p', 1, 1) -- add value 1 to field #1
--- ---
error: 'Illegal parameters, numeric operation on a field with length != 4' error: 'Field type does not match one required by operation: expected a 32-bit or 64-bit int'
... ...
localhost> lua box.update(0, 0, '=p', 1, 1) -- assign field #1 to value 1 localhost> lua box.update(0, 0, '+p', 0, 2) -- add value 2 to field 0
--- ---
- 0: {1} - 2: {'hello world'}
...
localhost> lua box.update(0, 0, '+p', 1, 1)
---
- 0: {2}
... ...
localhost> lua box.update(0, 2, '!p', 1, 'Bienvenue tout le monde!') localhost> lua box.update(0, 2, '!p', 1, 'Bienvenue tout le monde!')
--- ---
- 2: {'Bienvenue tout le monde!', 'Hello world!'} - 2: {'Bienvenue tout le monde!', 'hello world'}
... ...
localhost> lua box.update(0, 2, '#p', 2, 'Bienvenue tout le monde!') localhost> lua box.update(0, 2, '#p', 2, 1)
--- ---
- 2: {'Bienvenue tout le monde!'} - 2: {'Bienvenue tout le monde!'}
... ...
......
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