Writing a list

As with sets, we can directly specify the entire contents of a list, overwriting the current contents:

UPDATE "user_status_updates" SET "shared_by" = ['bob'] WHERE "username" = 'alice' AND "id" = 76e7a4d0-e796-11e3-90ce-5f98e903bf02; 

The literal for a list is just like that of a set, except that square brackets are used instead of curly braces. This, of course, is the syntax for array literals in a wide variety of programming languages.

Get Learning Apache Cassandra - Second Edition now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.