My table looks like this
create table Notes(
user_id varchar,
real_time timestamp,
insertion_time timeuuid,
read boolean PRIMARY KEY (user_id,real_time,insertion_time)
);
create index read_index on Notes (read);
I want update all the rows with user_id = 'xxx' without having to specify all the clustering indexes.
UPDATE Notes SET read = true where user_id = 'xxx'; // Says Error
Error: message="Missing mandatory PRIMARY KEY part real_time
I have tried creating a secondary index, but its not allowed on the primary key.
How can i solve this?
I chose user_id to be in the primary key cause i want to be able to do select * from Notes where user_id = 'xxx'
should be possible.
IN
clause for the last column of the primary key (i.e.insertion_time
from the authors question). Depending on your use case this is useful to reduce the required amount of CQL statements. – Queston