how can i collect table's attribute list (like rdbms's dictionary)


i want to collect table's all attribute list without table scan.

if i want to collect table's all attribute, need to all table scan? for example. (Id : Partition Key)

i can find "Id" attribute by DescribeTable, but "BicycleType", "Brand", "Color", "Description" ... attribute can't find

{ "Id": { "N": "205" }, "BicycleType": { "S": "Hybrid" }, "Brand": { "S": "Brand-Company C" }, "Color": { "L": [ { "S": "Red" }, { "S": "Black" } ] }, "Description": { "S": "205 Description" }, "Price": { "N": "500" }, "ProductCategory": { "S": "Bicycle" }, "Title": { "S": "18-Bike-204" } }

does aws dynamodb sdk support to collect table's all attribute list? like rdbms's dictionary catalog?

asked 2 years ago244 views
1 Answer
Accepted Answer

Describing the entire schema is not possible with DynamoDB, not without a table Scan. As DynamoDB's schema is flexible, there can be an unbounded number of attributes, unlike RDBMS where it is bounded and known.

Alternatively, if all of your items use the same schema, you can do a Scan with Limit=1 which will only Scan a single item, and you can obtain the attribute names from there.

profile pictureAWS
answered 2 years ago

You are not logged in. Log in to post an answer.

A good answer clearly answers the question and provides constructive feedback and encourages professional growth in the question asker.

Guidelines for Answering Questions