Advertisement
Guest User

Untitled

a guest
Apr 23rd, 2019
90
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.65 KB | None | 0 0
  1. var AWS = require('aws-sdk');
  2. var dynamodb = new AWS.DynamoDB();
  3.  
  4. exports.handler = async (event) => {
  5. // TODO implement
  6.  
  7. const params = {
  8. "TableName": "Harvests",
  9. "ProjectionExpression":"id, plantCount, harvestGrams, totalPlantGrams, classification, bay, strain, harvestLbs, totalPlantLbs, percentHarvestedPlantWeight, lbsHarvestedPerSqFt, plantsPerLight, harvestLbsPerLight, sqFtPerPlant",
  10. "ConsistentRead": true,
  11. "ReturnConsumedCapacity": "TOTAL"
  12. }
  13. const promiseResponse = await dynamodb.scan(params).promise();
  14.  
  15. const response = {
  16. statusCode: 200,
  17. ...promiseResponse
  18. };
  19. return response;
  20. };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement