Hier ist mein Code.
Ich möchte JSON in asset_data
Spalte einfügen. ich benutze aws sdk. Es sagt, dass aws sdk jetzt Unterstützung für json hat. http://aws.amazon.com/releasenotes/SDK/JavaScript/1691866671551861Wie json in dynamodb einfügen
var asset_data = {
"name": "name" + i,
"contentUrl": "http://www.hdwallpapersimages.com/nature-beauty-desktop-images/94892/",
"size": 300,
"headline": "headline",
"description": "assetUrl reference for the creator",
"encodingFormat": 'jpeg'
};
var params = {
TableName: 'xyz',
Item: { // a map of attribute name to AttributeValue
"asset_id": {S: "asset" + i},
"hit_id": {S: "0"},
"created_date": {"S": Date.now().toString()},
"status": {N: "0"},
"operation": {S: "image_tagging"},
"asset_data": {L: asset_data},
"source": {S: "DAM"},
"completed_date": {S: Date.now().toString()},
"response_data": {S: "taged value"}
// more attributes...
},
ReturnValues: 'NONE', // optional (NONE | ALL_OLD)
ReturnConsumedCapacity: 'NONE', // optional (NONE | TOTAL | INDEXES)
ReturnItemCollectionMetrics: 'NONE' // optional (NONE | SIZE)
};
db.putItem(params, function (err, data) {
if (err) console.log(err); // an error occurred
else console.log("inserted..."); // successful response
});
Gibt es eine Möglichkeit, diese DocumentClient() -Dinge von CLI zu verwenden, um einen Put-Artikel zu erstellen? Kann es nicht in der Dokumentation sehen. Danke! – Gopala