Collection Data Type: LIST
Explore Apache Cassandra's Collection data type LIST, which enable the storage of multiple values within a single column, providing flexibility in organizing and manipulating data.
In Apache Cassandra, collections are data types that store multiple values in a single column, enabling efficient data grouping, simplifying table design, providing efficient data retrieval and atomic operations.
Storing large amounts of data in a collection is an anti-pattern.
Cassandra does not support accessing individual elements of a collection, as collections are read in their entirety. The FROZEN
keyword is used to nest a collection inside another collection.
Cassandra provides the following three collection types:
SET
LIST
MAP
The LIST
collection
Like SET
, a LIST
groups and stores a collection of values in the same cell. However, the values need not be unique, and a value can appear multiple times. Additionally, the order of insertion is preserved in a LIST
. LIST
elements are enclosed in square brackets []
.
LIST
s are designed to store values in a particular order, representing a many-to-many relationship with another column in the table.
Get hands-on with 1300+ tech skills courses.