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

Popular posts from this blog

Spring Boot + JPA + Hibernate: Unable to locate persister -

go - Golang: panic: runtime error: invalid memory address or nil pointer dereference using bufio.Scanner -

c - double free or corruption (fasttop) -