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

0

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?

demandé il y a 2 ans307 vues
1 réponse
1
Réponse acceptée

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
EXPERT
répondu il y a 2 ans

Vous n'êtes pas connecté. Se connecter pour publier une réponse.

Une bonne réponse répond clairement à la question, contient des commentaires constructifs et encourage le développement professionnel de la personne qui pose la question.

Instructions pour répondre aux questions