Skip to content

index_object.parts methods #3444

Closed
@TarantoolBot

Description

@TarantoolBot

Related dev issue: tarantool/tarantool#7356

Product: Tarantool
Since: 3.0
Root document:

SME: @ Gumix

Details

index_object.parts has the following methods: extract_key(), compare(), compare_with_key(), merge().
For their description and usage examples, refer to Module key_def.

index_object.parts can be used like a key_def module instance for calling
the corresponding methods. 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}))

The code above is equivalent to:

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}))

Requested by @ Gumix in tarantool/tarantool@55295f5.

Metadata

Metadata

Assignees

Labels

3.0reference[location] Tarantool manual, Reference part

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions