Image shows the azure tableHow to retrieve latest record from Azure table storage using JavaScript?
I saw the article, How to retrieve latest record using RowKey or Timestamp in Azure Table storage
but i want to implement the same in Nodejs server side, Any suggestion. code so far,
var dt = Date().toLocaleString();
console.log("Got response: " + dt);
var entGen = azure.TableUtilities.entityGenerator;
var task = {
PartitionKey: entGen.String('ConfigData'),
RowKey: dt,
DeviceId: entGen.String(req.body.devId),
};
// Insert the entity to the table
tableSvc.insertEntity('configurationData', task, function (error, result, response) {
if (!error) {
// Entity inserted
console.log("Added the data in table successfully");
}
else{
console.log(error);
}
});
I got below error,
name: 'StorageError',
message: 'The \'RowKey\' parameter of value \'11/21/2017, 8:17:24 AM\' is out of range.\nRequestId:687de370-0002-0055-09a1-62d5e1000000\nTime:2017-11-21T08:17:25.6350503Z',
code: 'OutOfRangeInput',
statusCode: 400,
requestId: '687de370-0002-0055-09a1-62d5e1000000' }
Thanks in advance.