Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- var putObjectParams = {
- Bucket: BUCKET,
- Key: FILE_KEY,
- Body: 'some file content'
- };
- s3.putObject(putObjectParams, function(err, data) {
- if (err) {
- console.log(err, err.stack);
- } else {
- console.log(JSON.stringify(data));
- }
- });
- var docClient = new AWS.DynamoDB.DocumentClient();
- var queryParams = {
- TableName: ENV + "-WFMHistoricalUnprocessedFiles",
- ProjectionExpression: "filePath, ingressTime, dir, fileName",
- KeyConditionExpression: "#column = :fileFullPath",
- ExpressionAttributeNames: {
- "#column": "filePath"
- },
- ExpressionAttributeValues: {
- ":fileFullPath": BUCKET + "/" + FILE_KEY
- }
- };
- docClient.query(queryParams, function(err, data) {
- if (err) {
- console.log("Unable to query. Error:", JSON.stringify(err, null, 2));
- } else {
- console.log("Query succeeded.");
- data.Items.forEach(function(item) {
- console.log(JSON.stringify(item));
- });
- }
- });
- });`
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement