<reponame>abhishek100sahu/Conneted-Fleet<filename>Group2/g2_web/customer_validate.js<gh_stars>0function fetchone(){

    var AWS = require("aws-sdk");
    let awsConfig = {
        "region": "ap-south-1",
        "endpoint":"http://dynamodb.ap-south-1.amazonaws.com",
        "accessKeyId": "caf86f4uutaoxfysmf7anj01xl6sv3ps", "secretAccessKey": "kgfhvu9qnh3mr6eel97y6fq2hezzol8z"
    };
    AWS.config.update(awsConfig);

    let docClient = new AWS.DynamoDB.DocumentClient();

        var params = {
            TableName: "customer_data",
            Key: {
                "email_id": "dycjh@example.com"
            }
        };
        docClient.get(params, function (err, data) {
            if (err) {
                console.log("users::fetchOneByKey::error - " + JSON.stringify(err, null, 2));
            }
            else {
                console.log("users::fetchOneByKey::success - " + JSON.stringify(data, null, 2));
            }
        })

}

