created a table with the following rules: so with this, data should expire after 1 second (as per docs)
async function createTable() {
console.log("Creating Table");
const options = {
families: [
{
name: 'payloads',
rule: {
age: {
seconds: 1,
nanos: 0,
},
},
},
],
};
try {
await table.create(options);
console.log("Successfully Created Table");
} catch (err) {
console.error(`Error reading rows :`, err);
}
}
And then inserted the data like this:
const rowsToInsert = {
key: "SUMEET",
data: {
payloads: {
'1': {
value: "NOTIFICATIONS_PAYLOAD_1",
timestamp: 1576500927000,
},
'2': {
value: "NOTIFICATIONS_PAYLOAD_2",
timestamp: 1576587327000,
},
'3': {
value: "NOTIFICATIONS_PAYLOAD_3",
timestamp: 1576673727000,
},
'4': {
value: "NOTIFICATIONS_PAYLOAD_4",
timestamp: 1576760127000,
},
},
},
};
await table.insert(rowsToInsert);
so i added four cells with different timeStamp:
- First with 5 minutes ahead of time when am writing the data
- Second with 1 hour ahead
- third with 1 day ahead
- fourth with 2 day ahead
problem here is when m reading the data whole column family data is getting deleted but it should delete only first and second cell only as per the rules set
Is there anything am missing or am doing wrong ??