Does Amazon DynamoDB scan operation allow you to query on nested attributes of type Array
or Object
? For example,
{ Id: 206, Title: "20-Bicycle 206", Description: "206 description", RelatedItems: [ 341, 472, 649 ], Pictures: { FrontView: "123", RearView: "456", SideView: "789" } }
Can I query on RelatedItems[2]
or Pictures.RearView
attributes?
In addition to simple data types like numbers and strings DynamoDB supports these types: Nested object: A value of an attribute in DynamoDB can be a complex nested object.
You now can use a SQL-compatible query language to query, insert, update, and delete table data in Amazon DynamoDB. You now can use PartiQL (a SQL-compatible query language)—in addition to already-available DynamoDB operations—to query, insert, update, and delete table data in Amazon DynamoDB.
Unlike conventional relational databases, DynamoDB does not natively support a date and time data type. It can be useful instead to store data and time data as a number data type, using Unix epoch time.
The Query operation allows you to limit the number of items that it reads. To do this, set the Limit parameter to the maximum number of items that you want. For example, suppose that you Query a table, with a Limit value of 6 , and without a filter expression.
Yes, you can use a Filter Expression, which is just like Condition Expression. The section that talks about the functions that you can use in these types of expressions mentions the following:
"For a nested attribute, you must provide its full path; for more information, see Document Paths."
The Document Paths reference has examples on how to reference nested attributes in DynamoDB data types like List (what you are calling an array) and Map (what you are calling an object). Check out that reference for examples on how to do so:
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With