Skip to content

Commit 105b750

Browse files
committed
add general semantics section to FAQ
1 parent d14a270 commit 105b750

1 file changed

Lines changed: 17 additions & 0 deletions

File tree

docs/cqlengine/faq.rst

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -48,3 +48,20 @@ resolve to the statement with the lastest timestamp.
4848
assert MyModel.objects(id=1).first().count == 3
4949
assert MyModel.objects(id=1).first().text == '111'
5050
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

Comments
 (0)