space_object:replace() / put() | Tarantool
Submodule space_object:replace() / put()

space_object:replace() / put()

object space_object

Insert a tuple into a space. If a tuple with the same primary key already exists, replaces the existing tuple with a new one. The syntax variants and have the same effect; the latter is sometimes used to show that the effect is the converse of


the inserted tuple.



Possible errors:

  • ER_TUPLE_FOUND if a different tuple with the same unique-key value already exists. (This will only happen if there is a unique secondary index.)
  • ER_TRANSACTION_CONFLICT if a transaction conflict is detected in the MVCC transaction mode.

Complexity factors: Index size, Index type, Number of indexes accessed, WAL settings.

Example:{5000, 'tuple number five thousand'}

For more usage scenarios and typical errors see Example: using data operations further in this section.

Found what you were looking for?