I have a Cassandra 1.2 Column Family which looks like this:
food: 'steak'
value: 10
desserts: ['chocolate cake','banana pie','strawberry icecream']
And I need to delete one the desserts from this row , for instance 'chocolate cake' but if the list of desserts result in an empty list after removing one of the items I need to delete the entire row, is there a way to achieve this in a single query in Cassandra? If not, what's the best way to do it?
More info: the query I'm using to remove one of the items in the list is this:
update Table
set desserts = desserts - ['chocolate cake']
where food = 'steak'
Thanks in advance!