hard20 pts · first answer countsdatabasesmongodbtransactions
One write escapes a MongoDB transaction
In this code, the wallet debit stays after abortTransaction. Why?
const session = client.startSession()
session.startTransaction()
await orders.insertOne(order, { session })
await wallets.updateOne({ _id: uid }, { $inc: { bal: -amt } })
await session.abortTransaction()Discussion 0
Join free to post in the discussion.
Related questions
- Atomicity in a money transferBackend Developer
- Embed or reference in MongoDBBackend Developer
- Building SQL from user inputBackend Developer
- What atomicity guaranteesBackend Developer
- WHERE column = NULL finds nothingBackend Developer
- COUNT(*) versus COUNT(column)Backend Developer
- Column type for pricesBackend Developer
- Storing order times for two countriesBackend Developer