What You’ll Learn: Work with and manipulate the data from the previous unit with an overview of using CQL to UPDATE and DELETE the data in your Cassandra instance.

 

Because Cassandra never does a read before a write, INSERT and UPDATE in Cassandra are actually both “upserts”. INSERT and UPDATE both set the column values regardless of whether the data already exists.

Use the UPDATE command to update the change of a user, specifying the primary key. We are setting the user’s city from “Beverly Hills” to “San Jose”:

 

 

Lets take a look at the change we’ve made:

 

 

You should see:

update-delete-1

 

 

  • We can delete a row of data using the DELETE command:

 

 

 

  • Check and see that this row of data has been removed:

 

 

 

Now you should see:

update-delete-2

BackNext