CQL for Cassandra 2.x

Collection type

A collection column is declared using the collection type, followed by another type, such as int or text, in angle brackets. For example, you can create a table having a list of textual elements, a list of integers, or a list of some other element types.

list<text>
list<int>

Collection types cannot currently be nested. For example, you cannot define a list within a list:

list<list<int>>     \\not allowed

In Cassandra 2.1 and later, you can create an index on a column of type map, set, or list.

Show/hide