Selecting index from Cassandra list collection

2019-08-28 22:22发布

I was curious if it's possible to SELECT a specific index from a list collection in Cassandra. Say I have:

CREATE TABLE users (
  user_id text PRIMARY KEY,
  order_list list<text>
);

UPDATE users
   SET ordered_list = [ 'thing1', 'thing2', 'thing3' ] WHERE user_id = 'user1';

Is it possible to then get back an index of ordered_list, such as ordered_list[1] from a CQL query instead of the entire list?

1条回答
\"骚年 ilove
2楼-- · 2019-08-28 23:04

No, you can't. You can UPDATE and DELETE with subscripts, but not SELECT or INSERT.

查看更多
登录 后发表回答