MongoDB รองรับ multi-document ACID transaction (ตั้งแต่ v4.0 สำหรับ replica set, v4.2 สำหรับ sharded cluster) — จัดกลุ่ม operation ข้ามหลายเอกสาร/หลาย collection เพื่อให้ทั้งหมดสำเร็จหรือล้มเหลวพร้อมกัน อย่างไรก็ตาม โมเดลเอกสารของ MongoDB มักทำให้ transaction ไม่จำเป็น ผ่าน operation แบบ atomic บนเอกสารเดี่ยว
operation บนเอกสารเดี่ยวเป็น atomic อยู่แล้ว
KEY POINT: operations on a SINGLE document are ALWAYS atomic in MongoDB.
→ Because related data is often EMBEDDED in one document, many operations that would
need a transaction in SQL are a single atomic document update in MongoDB.
→ Good schema design (embedding) often eliminates the NEED for multi-doc transactions.
