Hello, hope you're having a good day. I have a user defined type:
CREATE TYPE hashtag ( id text, creator_id text, text text, updated timestamp );
Used in:
CREATE TABLE post ( id bigint, user text, thread_id text, hashtags set<frozen <hashtag>>, post_body text, created timestamp, updated timestamp, PRIMARY KEY ((thread_id, user), id) ) WITH CLUSTERING ORDER BY (id DESC);
Is it possible to ensure that on executing the query below 2 times - it won't add 2 values to the set, but verify uniqueness by id? If not, obviously I should use a map. Just curious if it's possible to configure in which way Cassandra defines uniqueness of a set.
UPDATE post SET hashtags = hashtags + { { id: 'some_hashtag_id', creator_id: '78ead5b6-187b-4f6e-9945-a72ab95483f3', text: '#nice', updated: toTimestamp(now()) } } WHERE thread_id='24283c41-b829-4a7d-91c7-cd1277e0a5f7' AND user='78ead5b6-187b-4f6e-9945-a72ab95483f3' AND id=512988294041042944;