const mongoose = require(“ mongoose”)
const {Transaction-manager}= require("mongodb-tx")
const mgr = new Transaction-manager({mongoose})
await mgr.transaction(async (t) => {
let voucher_Ids = await vouchers.find({ voucher_status: 'Created', status: true }, { _id: 1 },{transaction: t, lock: t.LOCK}).limit(issue.vouchers_count);
console.log(voucher_Ids)
if (!voucher_Ids) {
throw new Error("conditions not satisfied")
}
})