MongoDB decrement until zero

前端 未结 0 472
太阳男子
太阳男子 2021-02-12 14:53

I would like to achieve an operation in MongoDB that would be analogous to doc.value = max(doc.value - amount, 0). I could do it by fetching document, updating its

相关标签:
回答
  • 消灭零回复
提交回复
热议问题