contains
to check if a
set
contains an element in a LWT.
cqlsh> UPDATE users SET primary_email = 'me@gmail.com' WHERE user_id = cb6995ea-b83c-11ea-b748-acde48001122 IF linked_emails CONTAINS 'me@gmail.com'; An error occurred on line 1: line 1:118 no viable alternative at input 'CONTAINS' (...user_id = cb6995ea-b83c-11ea-b748- acde48001122 if linked_emails [CONTAINS]...)
linked_emails
from a
set<text>
to a
map<text, boolean>
with only
true
values and changing the condition to
if linked_emails['me@gmail.com'] = true
. This way, if the key doesn’t exist,
null
is returned and the condition will be false.
contains key
and
contains
, so what is the reason this workaround is needed?