You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/conditional.rst
+45-81Lines changed: 45 additions & 81 deletions
Original file line number
Diff line number
Diff line change
@@ -1,11 +1,9 @@
1
1
Conditional Operations
2
2
======================
3
3
4
-
Some DynamoDB operations (UpdateItem, PutItem, DeleteItem) support the inclusion of conditions. The user can supply a list of conditions to be
5
-
evaluated by DynamoDB before the operation is performed, as well as specifying whether those conditions are
6
-
applied with logical OR (at least one must be true) or logical AND (all must be true). See the `official documentation <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html#ConditionalExpressions>`_
7
-
for more details. PynamoDB supports conditionals through keyword arguments, using syntax that is similar to the filter syntax (see :ref:`filtering`).
8
-
Multiple conditions may be supplied, and each value provided will be serialized using the serializer defined for that attribute.
4
+
Some DynamoDB operations (UpdateItem, PutItem, DeleteItem) support the inclusion of conditions. The user can supply a condition to be
5
+
evaluated by DynamoDB before the operation is performed. See the `official documentation <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/WorkingWithItems.html#WorkingWithItems.ConditionalUpdate>`_
6
+
for more details.
9
7
10
8
Suppose that you have defined a `Thread` Model for the examples below.
11
9
@@ -25,114 +23,80 @@ Suppose that you have defined a `Thread` Model for the examples below.
25
23
subject = UnicodeAttribute(range_key=True)
26
24
views = NumberAttribute(default=0)
27
25
28
-
29
-
AND vs. OR
30
-
^^^^^^^^^^
31
-
32
-
Specifying that the conditions should be applied with AND or OR is achieved through the use of the `conditional_operator` keyword,
33
-
which can be `and` or `or`.
26
+
.. _conditions:
27
+
28
+
Condition Expressions
29
+
^^^^^^^^^^^^^^^^^^^^^
30
+
31
+
PynamoDB supports creating condition expressions from attributes using a mix of built-in operators and method calls.
32
+
Any value provided will be serialized using the serializer defined for that attribute.
33
+
See the `comparison operator and function reference <http://docs.aws.amazon.com/amazondynamodb/latest/developerguide/Expressions.OperatorsAndFunctions.html>`_
34
+
for more details.
35
+
36
+
.. csv-table::
37
+
:header: DynamoDB Condition, PynamoDB Syntax, Example
0 commit comments