Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var AWS = require('aws-sdk');
- var dynamodb = new AWS.DynamoDB();
- exports.handler = async (event) => {
- // TODO implement
- const params = {
- "TableName": "Harvests",
- "ProjectionExpression":"id, plantCount, harvestGrams, totalPlantGrams, classification, bay, strain, harvestLbs, totalPlantLbs, percentHarvestedPlantWeight, lbsHarvestedPerSqFt, plantsPerLight, harvestLbsPerLight, sqFtPerPlant",
- "ConsistentRead": true,
- "ReturnConsumedCapacity": "TOTAL"
- }
- const promiseResponse = await dynamodb.scan(params).promise();
- const response = {
- statusCode: 200,
- ...promiseResponse
- };
- return response;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement