Updated at July 17, 2026 02:08 PM
tuple_object:format()
tuple_object method format()
Get the format of a tuple. The resulting table lists the fields of a
tuple (their names and types) if the format option was specified
during the tuple creation. Otherwise, the return value is empty.
Returns
the tuple format.
Return type
table
Example:
-
A formatted tuple:
tarantool> f = box.tuple.format.new({{'id', 'number'}, {'name', 'string'}})---...tarantool> ftuple = box.tuple.new({1, 'Bob'}, {format = f})---...tarantool> ftuple:format()---- [{'name': 'id', 'type': 'number'}, {'name': 'name', 'type': 'string'}]...tarantool> box.tuple.format(ftuple)---- [{'name': 'id', 'type': 'number'}, {'name': 'name', 'type': 'string'}]... -
A tuple without a format:
tarantool> tuple1 = box.tuple.new({1, 'Bob'}) -- no format---...tarantool> tuple1:format()---- []...tarantool> box.tuple.format(tuple1)---- []...