A
A
alameya2017-02-08 00:18:43
NoSQL
alameya, 2017-02-08 00:18:43

How to select by multi part index in tarantool?

Actually there is an index

box.space.posts:create_index('category_listing', {
    type = 'tree',
    parts = { 8, 'integer', 12, 'string' } ,
    unique = false,
    if_not_exists = true
});

8 field is a timestamp
12 - post type
The problem occurs when trying to specify an iterator
box.space.posts.index.category_listing:select({ 1486499758, 'videos' } , {
        iterator = box.index.GT,
        limit = limit,
        offset = offset
})

You must select articles from the 'videos' category where the timestamp is greater than the specified date

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question