index_object:update() | Tarantool

index_object:update()

object index_object
index_object:update(key, {{operator, field_identifier, value}, ...})

Update a tuple.

Same as box.space…update(), but key is searched in this index instead of primary key. This index should be unique.

Parameters:
  • index_object (index_object) – an object reference.
  • key (scalar/table) – values to be matched against the index key
  • operator (string) – operation type represented in string
  • field_identifier (field-or-string) – what field the operation will apply to. The field number can be negative, meaning the position from the end of tuple. (#tuple + negative field number + 1)
  • value (lua_value) – what value will be applied
Return:
  • the updated tuple
  • nil if the key is not found
Rtype:

tuple or nil

Since Tarantool 2.3 a tuple can also be updated via JSON paths.

Found what you were looking for?
Feedback