const updateFund = await Fund.findOneAndUpdate(
** { chainId, _id: “650d89e4d660326eb6799167” },**
** [**
** {**
** $inc: {**
** usedBalance: -balance,**
** balance: +balance,**
** },**
** },**
** {**
** $set: {**
** status: {**
** $cond: {**
** if: {**
** $eq: [“$usedBalance”, 0] ? false : true,**
** },**
** },**
** },**
** },**
** },**
** ],**
** { new: true }**
** );**
Please update your post after reading:
Also update your post title to something shorter and put the explication of the issue as text within the post.