Can we use the atomic MongoDB increment operator? #10311
-
We are storing financial information in our DB, and it is important that updates to the financial records are atomic. I.e. we don't want to read, then write because that allows for a window where other processes can also write to the record, causing data problems. Ideally, we'd like to use the atomic MongoDB increment operator. However, I can't seem to find how to do that using Payload. Is it possible using the local update API? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
I've been doing some extra investigation, and I think it's possible using |
Beta Was this translation helpful? Give feedback.
I've been doing some extra investigation, and I think it's possible using
payload.db.collections
which gives direct access to the Mongoose model. Consider this closed!