mongodb: Spring Data MongoDB transactions, aggregation and compound index (post 26)

This commit is contained in:
2026-10-14 19:05:36 +00:00
parent 0e631d2cfa
commit 23f4b1bad9
16 changed files with 469 additions and 1 deletions
+2
View File
@@ -0,0 +1,2 @@
query on indexed fields (customerId, createdAt): winning plan stage = FETCH IXSCAN
query on unindexed field (total): winning plan stage = COLLSCAN
@@ -0,0 +1,2 @@
order_id=6acfd210bf211a8919681ce9 status=PLACED total=199.90
inventory_before=50 inventory_after=40 (decremented by order quantity)
@@ -0,0 +1,3 @@
attempted_quantity=999 available=5 -> Insufficient stock for WIDGET-2: available=5 requested=999
inventory_before=5 inventory_after=5 (unchanged - transaction rolled back)
orders_collection_count=0 (no order document was inserted)
@@ -0,0 +1,2 @@
status=PLACED total_revenue=350.00 order_count=2
status=REJECTED_INSUFFICIENT_STOCK total_revenue=40.00 order_count=1