Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- const AWS = require('aws-sdk');
- const docClient = new AWS.DynamoDB.DocumentClient();
- exports.handler = async (event) => {
- let params4 = {
- TableName: "pool4-dev",
- IndexName: "index-datetime",
- KeyConditionExpression: "#date = :dateValue",
- FilterExpression: "#idx1 = :idx1 AND begins_with(#id,:id) ",
- ExpressionAttributeNames: {
- "#date": "date",
- "#idx1": "idx1",
- "#id": "id"
- },
- ExpressionAttributeValues: {
- ":dateValue": '2019-01-01',
- ":idx1": 'WELL-34243-234243',
- ":id": "DATAPOINTDATA"
- }
- };
- // console.log("params4===========", params4);
- try {
- var data = await docClient.query(params4).promise();
- console.log("data.Items ============", data.Items);
- } catch (err) {
- console.log(err);
- return err;
- }
- // TODO implement
- const response = {
- statusCode: 200,
- body: JSON.stringify('Hello from Lambda!'),
- };
- return response;
- };
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement