从Cassandra列表集合中选择索引 [英] Selecting index from Cassandra list collection

查看:248
本文介绍了从Cassandra列表集合中选择索引的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我很好奇,如果可以从Cassandra中的列表集合中选择特定的索引。说我有:

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';

可以从CQL获取ordered_list的索引,例如ordered_list [1]查询而不是整个列表?

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?

推荐答案

不,你不能。您可以使用下标 UPDATE DELETE ,但不能 SELECT INSERT

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

这篇关于从Cassandra列表集合中选择索引的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆