MCPcopy Index your code
hub / github.com/apache/cassandra-python-driver / if_exists

Method if_exists

cassandra/cqlengine/query.py:1191–1201  ·  view source on GitHub ↗

Check the existence of an object before an update or delete. If the update or delete isn't applied, a LWTException is raised.

(self)

Source from the content-addressed store, hash-verified

1189 return clone
1190
1191 def if_exists(self):
1192 """
1193 Check the existence of an object before an update or delete.
1194
1195 If the update or delete isn't applied, a LWTException is raised.
1196 """
1197 if self.model._has_counter:
1198 raise IfExistsWithCounterColumn('if_exists cannot be used with tables containing counter columns')
1199 clone = copy.deepcopy(self)
1200 clone._if_exists = True
1201 return clone
1202
1203 def update(self, **values):
1204 """

Calls 1