index_object.parts | Tarantool

index_object.parts

object index_object
index_object.parts

The index’s key parts. Since version 3.0.0, the index_object.parts can operate methods extract_key(), compare(), compare_with_key(), merge().

Since version 3.1.0, the index_object.parts can operate methods validate_key(), validate_full_key(), validate_tuple(), compare_keys().

``index_object.parts`` example

box.schema.space.create('T')
i = box.space.T:create_index('I', {parts={3, 'string', 1, 'unsigned'}})
box.space.T:insert{1, 99.5, 'X', nil, 99.5}
i.parts:extract_key(box.space.T:get({'X', 1}))

``key_def`` equivalent

key_def = require('key_def')
box.schema.space.create('T')
i = box.space.T:create_index('I', {parts={3, 'string', 1, 'unsigned'}})
box.space.T:insert{1, 99.5, 'X', nil, 99.5}
k = key_def.new(i.parts)
k:extract_key(box.space.T:get({'X', 1}))

The outcome of the methods calling is described in key_def_object.

rtype:table

See also: index_opts.parts

Found what you were looking for?
Feedback