I have found the code for remove item from a collection but I am not able to figure out how to do it with my expiry date with upcoming date that matches and item get deleted? Please help
import wixData from 'wix-data';
// ...
let options = {
"suppressAuth": true,
"suppressHooks": true
};
wixData.remove("myCollection", "00001", options)
.then((results) => {
if(results.items.length > 0) {
console.log(results.items[0]); //see item below
} else {
// handle case where no matching items found
}
})
.catch((err) => {
console.log(err);
});
/* item is:
*
* {
* "_id": "00001",
* "_owner": "ffdkj9c2-df8g-f9ke-lk98-4kjhfr89keedb",
* "_createdDate": "2017-05-24T12:33:18.938Z",
* "_updatedDate": "2017-05-24T12:33:18.938Z",
* "title": "Mr.",
* "first_name": "John",
* "last_name": "Doe"
* }
*/