I am trying to use loki js in order to filter the objects whose timestamps are older than current:
public getExpiredElements(): any[] {
let currentDate = new Date().toISOString();
console.log(currentDate);
return this.collectionName.chain().find(this.collection).where( (obj) => {
console.log(obj.expirationTimeStamp);
obj.expirationTimeStamp < currentDate;
}).data();
}
I get empty table though. Is my syntax correct?