Hi,
I’m trying to filter Members/PrivateMembersData to return all records that are updated in the last day. The query keeps returning all records. It seems like the filter isn’t working properly.
let options = {
"suppressAuth": true,
"suppressHooks": true
};
let filterDate = new Date(
new Date().getFullYear(),
new Date().getMonth(),
new Date().getDate()-1 //Yesterday
);
console.log(filterDate);
wixData.query("Members/PrivateMembersData")
.ge("_updatedDate", filterDate)
.find(options)
.then( (results) => {
console.log(results);
} );
If I modify the filter to filter on _createdDate instead of _updatedDate, the filter works.
.ge("_createdDate", filterDate)
If I change the filter to .le(“_updatedDate”, filterDate) no values are returned (data is present).
I checked the collection, _updatedDate is filled in for each record.
Am I doing something wrong, or am I missing something regarding “_updatedDate”?
Thanks,
Sam