Я создаю пространство с двумя индексами - первичным и вторичным:
box.schema.sequence.create('user_seq', { if_not_exists = true })
box.schema.space.create('user', {
if_not_exists = true,
format = {
{ name = 'id', type = 'unsigned'},
{ name = 'bio', type = 'string'}
}
})
box.space.user:create_index('id', {
sequence = 'user_seq',
parts = {'id'}
})
box.space.user:create_index('bio', {
parts = {'bio'},
if_not_exists = true,
unique = false
})
Вставьте кортеж:
tarantool> box.space.user:insert({ box.sequence.user_seq:next(), 'other stuff'})
---
- [1, 'other stuff']
...
Я пробовал искать вот так:
box.space.user:select({'other stuff'})
И получил ошибку:
- error: 'Supplied key type of part 0 does not match index part type: expected unsigned'
Как мне искать по вторичным индексам?