liveBook · Manning

List

As explained in ScyllaDB in Action

A list is an ordered collection type that can contain multiple values, including duplicate values, of one specified type.

A list is an ordered collection of values sharing one declared type. It can contain duplicates and is useful when a row needs a small, ordered group of items. section 4.5 section 4.5.1

ScyllaDB supports these list operations:

  • Append or prepend lists with +; list + values appends, while values + list prepends. section 4.5.1
  • Remove matching values with -, replace an indexed value, delete an indexed value, or replace the entire list. section 4.5.1

A list changing over time

Start with ['a', 'b', 'c']. Appending ['d', 'e'] produces ['a', 'b', 'c', 'd', 'e']; replacing index 0 with 'z' produces ['z', 'b', 'c', 'd', 'e']; deleting index 0 removes 'z'. Indexes outside the list produce an error. section 4.5.1

Use lists cautiously for repeated updates: appending is not idempotent, so repeating the same operation can create duplicate entries. Prefer a separate table when the collection is large or may grow without a known limit. section 4.5.1 section 4.5 section 4.7

Figure 4.3 Scylla supports storing multiple values in its collection data types: lists, sets, and maps.
figure

Compare lists with sets and maps to choose the collection type that matches ordering, uniqueness, and key-value requirements. section 4.5

How ScyllaDB in Action covers it

How deep it goes
Explains declaration, insertion, concatenation, removal, indexing, replacement, and non-idempotent append behavior.
Examples
Uses CQL commands that insert, append, remove, replace, delete, select, and reset a three-element text list.
What it assumes
Assumes basic CQL table and update usage while introducing collection typing and list-specific operations through examples.
What you can do after
Operate/configure typed lists with CQL and recognize when duplicate-producing updates or unbounded growth require another design.
How it connects
Contrasts lists with sets, maps, tables, and user-defined types.

Also explained in

Compare how 21 books explain list →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of ScyllaDB in Action. The section links point to the parts of the book it draws on.