Advertisement
Guest User

Untitled

a guest
Feb 21st, 2017
65
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.24 KB | None | 0 0
  1. var putObjectParams = {
  2. Bucket: BUCKET,
  3. Key: FILE_KEY,
  4. Body: 'some file content'
  5. };
  6.  
  7. s3.putObject(putObjectParams, function(err, data) {
  8. if (err) {
  9. console.log(err, err.stack);
  10. } else {
  11. console.log(JSON.stringify(data));
  12. }
  13. });
  14.  
  15.  
  16. var docClient = new AWS.DynamoDB.DocumentClient();
  17. var queryParams = {
  18.  
  19. TableName: ENV + "-WFMHistoricalUnprocessedFiles",
  20. ProjectionExpression: "filePath, ingressTime, dir, fileName",
  21. KeyConditionExpression: "#column = :fileFullPath",
  22. ExpressionAttributeNames: {
  23. "#column": "filePath"
  24. },
  25. ExpressionAttributeValues: {
  26. ":fileFullPath": BUCKET + "/" + FILE_KEY
  27. }
  28. };
  29.  
  30. docClient.query(queryParams, function(err, data) {
  31.  
  32. if (err) {
  33. console.log("Unable to query. Error:", JSON.stringify(err, null, 2));
  34. } else {
  35. console.log("Query succeeded.");
  36. data.Items.forEach(function(item) {
  37. console.log(JSON.stringify(item));
  38. });
  39. }
  40. });
  41.  
  42. });`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement