static async updatePaidLeave() {
const result = await PaidUnpaidLeaveSchema.find({});
console.log(result, ";;;;;;;");
}
static runCronJob() {
cron.schedule("*/10 * * * * *", async () => {
this.updatePaidLeave();
console.log(this.updatePaidLeave(), "Im running in every 10 seconds.");
});
}
Output // Promise { } Im running in every 10 seconds.
i have tried above code and i want data from PaidUnpaidLeaveSchema