I want to retrieve the data for some interval(ex- 7 days) time in that interval there is possible data has come for 5day and for two days data is not coming and again data start coming from the 8th day onward ...
I am trying to retrieve between some intervals let us say for the day so I am giving the start time as the present time (millisecond because the sort key column is millisecond) and the end time as 7 days ago whatever millisecond will be there but I am getting nothing for that interval I am expecting data for 5days because of that 2days data not coming it showing 0 record, and whenever I am giving time interval between that 5 day then I am getting data .
const getAllConfigData = async (
tableName,
process_uuid,
startTime,
endTime,
parametersNames
) => {
let result = "";
parametersNames.push("#DocTimestamp");
for (let j = 0; j < parametersNames.length; j++) {
result = result.concat(",", parametersNames[j]);
}
// console.log(result);
var parameterNamesString = result.replace(result[0], "");
// parameterNamesString.push("timestamp");
console.log(parameterNamesString);
parametersNames.splice(-1);
console.log(parametersNames);
var params = {
TableName: tableName,
KeyConditionExpression:
"process_uuid = :id AND #DocTimestamp BETWEEN :start AND :end",
ExpressionAttributeNames: {
"#DocTimestamp": "timestamp",
},
ExpressionAttributeValues: {
":id": process_uuid,
":start": startTime,
":end": endTime,
},
ProjectionExpression: parameterNamesString,
};
return await ddbDocClient.send(new QueryCommand(params));
};
in this whay my data is present in dynamodb which is coming from sensor there some time stop for some interval