somecallmemike
somecallmemike

Reputation: 441

Selecting index from Cassandra list collection

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?

Upvotes: 0

Views: 559

Answers (1)

Theo
Theo

Reputation: 132972

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

Upvotes: 1

Related Questions