Removing values from a set

Let's say that dave has second thoughts and no longer wishes to have starred alice's status update. We can just as easily remove his name from the list:

UPDATE "user_status_updates" SET "starred_by_users" = "starred_by_users" - {'dave'} WHERE "username" = 'alice' AND "id" = 76e7a4d0-e796-11e3-90ce-5f98e903bf02; 

This is identical to our previous query, except that we use a - operator to indicate removal rather than a + operator to indicate addition.

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.