Ich verwende Node.jsWie bekomme ich alle Felder in aws-dynamoDB?
var AWS = require('aws-sdk');
AWS.config.update({
region: "region",
endpoint: "https://dynamodb.region.amazonaws.com"
});
var dynamodb = new AWS.DynamoDB();
var params = {
TableName: "acc_new"
};
dynamodb.describeTable(params, function(err, data) {
if (err) console.log(err, err.stack); // an error occurred
else console.log(JSON.stringify(data));
});
Output:
{ AttributeDefinitions: [ { AttributeName: 'Id', AttributeType: 'S' } ],
TableName: 'acc_new',
KeySchema: [ { AttributeName: 'Id', KeyType: 'HASH' } ],
ProvisionedThroughput: { ReadCapacityUnits: 5, WriteCapacityUnits: 5 } }
Ausgang nur Schlüsselschemata (nur Hash und Bereichsschlüssel) bestehen, die mit dem Tisch verbunden sind, nicht alle Attribute. Ich möchte alle Attribute abrufen, die mit Daten in der Tabelle verknüpft sind.
Like:
{ AttributeName: 'AccountName', AttributeType: 'S' }
{ AttributeName: 'CreatedBy', AttributeType: 'S' }
...
...
Gibt es eine Möglichkeit Beschreibungen einer DynamoDB Tabelle mit all seinen Datenfelder zu erhalten.
Nein, gibt es nicht. Siehe [diese] (https://stackoverflow.com/a/20919174/3770040) Antwort. –
Mögliches Duplikat von [Ermitteln aller Attribute einer AWS DynamoDB-Tabelle programmgesteuert?] (Https://stackoverflow.com/questions/20919012/discovering-all-attributes-of-a-aws-dynamodb-table-programmatically) –