I want to set status based on the usedBalance, if usedBalance is 0 then set status false and if not then set true but when i use $inc operator in pipeline then it's gave me an error like 'Invalid update pipeline operator: "$inc"'

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.