DynamoDB customization reference#
Valid DynamoDB types#
These are the valid item types to use with Boto3 Table Resource (dynamodb.Table) and DynamoDB:
| Python Type | DynamoDB Type | 
|---|---|
| string | String (S) | 
| integer | Number (N) | 
| 
 | Number (N) | 
| Binary (B) | |
| boolean | Boolean (BOOL) | 
| 
 | Null (NULL) | 
| string set | String Set (SS) | 
| integer set | Number Set (NS) | 
| 
 | Number Set (NS) | 
| Binary Set (BS) | |
| list | List (L) | 
| dict | Map (M) | 
Custom Boto3 types#
DynamoDB conditions#
- class boto3.dynamodb.conditions.Key(name)[source]#
- begins_with(value)#
- Creates a condition where the attribute begins with the value. - Parameters:
- value – The value that the attribute begins with. 
 
 - between(low_value, high_value)#
- Creates a condition where the attribute is greater than or equal to the low value and less than or equal to the high value. - Parameters:
- low_value – The value that the attribute is greater than or equal to. 
- high_value – The value that the attribute is less than or equal to. 
 
 
 - eq(value)#
- Creates a condition where the attribute is equal to the value. - Parameters:
- value – The value that the attribute is equal to. 
 
 - gt(value)#
- Creates a condition where the attribute is greater than the value. - Parameters:
- value – The value that the attribute is greater than. 
 
 - gte(value)#
- Creates a condition where the attribute is greater than or equal to
- the value. 
 - Parameters:
- value – The value that the attribute is greater than or equal to. 
 
 - lt(value)#
- Creates a condition where the attribute is less than the value. - Parameters:
- value – The value that the attribute is less than. 
 
 - lte(value)#
- Creates a condition where the attribute is less than or equal to the
- value. 
 - Parameters:
- value – The value that the attribute is less than or equal to. 
 
 
- class boto3.dynamodb.conditions.Attr(name)[source]#
- Represents an DynamoDB item’s attribute. - attribute_type(value)[source]#
- Creates a condition for the attribute type. - Parameters:
- value – The type of the attribute. 
 
 - begins_with(value)#
- Creates a condition where the attribute begins with the value. - Parameters:
- value – The value that the attribute begins with. 
 
 - between(low_value, high_value)#
- Creates a condition where the attribute is greater than or equal to the low value and less than or equal to the high value. - Parameters:
- low_value – The value that the attribute is greater than or equal to. 
- high_value – The value that the attribute is less than or equal to. 
 
 
 - contains(value)[source]#
- Creates a condition where the attribute contains the value. - Parameters:
- value – The value the attribute contains. 
 
 - eq(value)#
- Creates a condition where the attribute is equal to the value. - Parameters:
- value – The value that the attribute is equal to. 
 
 - gt(value)#
- Creates a condition where the attribute is greater than the value. - Parameters:
- value – The value that the attribute is greater than. 
 
 - gte(value)#
- Creates a condition where the attribute is greater than or equal to
- the value. 
 - Parameters:
- value – The value that the attribute is greater than or equal to. 
 
 - is_in(value)[source]#
- Creates a condition where the attribute is in the value, - Parameters:
- value (list) – The value that the attribute is in. 
 
 - lt(value)#
- Creates a condition where the attribute is less than the value. - Parameters:
- value – The value that the attribute is less than. 
 
 - lte(value)#
- Creates a condition where the attribute is less than or equal to the
- value. 
 - Parameters:
- value – The value that the attribute is less than or equal to.