Cassandra: update value of a clustering column -


i have created table:

create table postsbyuser(   userid bigint,   posttime timestamp,   postid uuid,   postcontent text,   year bigint,   primary key ((userid,year), posttime) ) clustering order (posttime desc);  

my query user posts in 1 year ordered desc posttime. ordering ok, problem posttime changed if user edits postcontent:

update postsbyuser set postcontent='edited content' , posttime=edit_time userid=id , year=year 

i error : [invalid query] message="primary key part time found in set part"

have idea how order posts changing time ?

you should specify clustering column in query.

update postsbyuser set postcontent='edited content' , posttime=edit_time userid=id , year=year , posttime=previous_post_time 

Comments