How can I set a value of a row to null in cassandra? For example I have a table like this:
CREATE TABLE instruments (
code text,
ric text,
primary key (code)
)
if I want an element to have a particular ric
:
update instruments set ric='test' where code='code';
But what about setting ric
to None
?
It might be done with DELETE
CQL command:
DELETE ric FROM instruments WHERE code='code';
You can also use the value null
in your queries. This was added last year to CQL.
update keyspace.table set ric=null where code='code';
You can also use null
in insert
statements, but if you omit the value it's the same as saying null
so there's no point.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With