We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent d14a270 commit 105b750Copy full SHA for 105b750
1 file changed
docs/cqlengine/faq.rst
@@ -48,3 +48,20 @@ resolve to the statement with the lastest timestamp.
48
assert MyModel.objects(id=1).first().count == 3
49
assert MyModel.objects(id=1).first().text == '111'
50
51
+How can I delete individual values from a row?
52
+-------------------------------------------------
53
+
54
+When inserting with CQLEngine, ``None`` is equivalent to CQL ``NULL`` or to
55
+issuing a ``DELETE`` on that column. For example:
56
57
+.. code-block:: python
58
59
+ class MyModel(Model):
60
+ id = columns.Integer(primary_key=True)
61
+ text = columns.Text()
62
63
+ m = MyModel.create(id=1, text='We can delete this with None')
64
+ assert MyModel.objects(id=1).first().text is not None
65
66
+ m.update(text=None)
67
+ assert MyModel.objects(id=1).first().text is None
0 commit comments