How to delete rows based on 'non key' column criteria...

39 views
Skip to first unread message

Alex

unread,
Oct 29, 2012, 5:40:59 AM10/29/12
to hel...@googlegroups.com
Hi, I'm relatively new to both cassandra and helenus so pls forgive if this Q is just highlighting that I'm "not getting how cassandra works". (Blame too many yrs of RDBMS !)

I'm trying to delete from my CF based on non key column criteria; so :

DELETE from USERS where firstName = 'Alex'
(firstName is not the key)

I see that delete only accepts keys in the where clause (with cql); so hence thought I should first select all key values where firstName = 'Alex' and then pass those to a subsequent delete ...

DELETE from USERS where uuid in ([1,2,3,4,]);

Is this the way to go about doing this and if so would anyone be able to help me out with a small bit of javascript by way of an example pls ?

Yours hopefully,
Alex

Russell Bradberry

unread,
Oct 29, 2012, 9:31:38 AM10/29/12
to hel...@googlegroups.com
AFAIK The way you stated it is currently the only way.  I'm not sure if secondary-index support is included in DELETE statements.
Reply all
Reply to author
Forward
0 new messages