Selecting index from Cassandra list collection

社会主义新天地 提交于 2019-12-13 04:31:09

问题


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:


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



来源:https://stackoverflow.com/questions/18071334/selecting-index-from-cassandra-list-collection

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!