[PR #7241] [MERGED] docs: clarify MongoDB adapter transaction default behavior #24068

Closed
opened 2026-04-15 22:09:38 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7241
Author: @MuzzaiyyanHussain
Created: 1/10/2026
Status: ✅ Merged
Merged: 1/10/2026
Merged by: @himself65

Base: canary ← Head: docs/mongodb-transaction-default


📝 Commits (1)

  • a30a083 docs: clarify MongoDB adapter transaction default behavior

📊 Changes

1 file changed (+5 additions, -3 deletions)

View changed files

📝 packages/better-auth/src/adapters/mongodb-adapter/mongodb-adapter.ts (+5 -3)

📄 Description

What changed

  • Updated MongoDB adapter JSDoc to reflect the actual default behavior
  • Clarified that transactions default to true when a MongoDB client is provided
  • Added guidance for disabling transactions on MongoDB instances that do not support them

Why

The documentation stated that transactions default to false, but the code enables
transactions when a MongoDB client is provided. This mismatch caused unexpected
failures in production for databases without transaction support.

Related issue

Closes #7213


Summary by cubic

Clarified MongoDB adapter docs: transactions default to true when a MongoDB client is provided, not false. Added guidance to set transaction: false for instances without transaction support (e.g., standalone servers) to prevent failures.

Written for commit a30a083d04. Summary will update on new commits.


🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.

## 📋 Pull Request Information **Original PR:** https://github.com/better-auth/better-auth/pull/7241 **Author:** [@MuzzaiyyanHussain](https://github.com/MuzzaiyyanHussain) **Created:** 1/10/2026 **Status:** ✅ Merged **Merged:** 1/10/2026 **Merged by:** [@himself65](https://github.com/himself65) **Base:** `canary` ← **Head:** `docs/mongodb-transaction-default` --- ### 📝 Commits (1) - [`a30a083`](https://github.com/better-auth/better-auth/commit/a30a083d04d854bae7a91847e3c98ee31a4ec5f8) docs: clarify MongoDB adapter transaction default behavior ### 📊 Changes **1 file changed** (+5 additions, -3 deletions) <details> <summary>View changed files</summary> 📝 `packages/better-auth/src/adapters/mongodb-adapter/mongodb-adapter.ts` (+5 -3) </details> ### 📄 Description ### What changed - Updated MongoDB adapter JSDoc to reflect the actual default behavior - Clarified that transactions default to `true` when a MongoDB client is provided - Added guidance for disabling transactions on MongoDB instances that do not support them ### Why The documentation stated that transactions default to `false`, but the code enables transactions when a MongoDB client is provided. This mismatch caused unexpected failures in production for databases without transaction support. ### Related issue Closes #7213 <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Clarified MongoDB adapter docs: transactions default to true when a MongoDB client is provided, not false. Added guidance to set transaction: false for instances without transaction support (e.g., standalone servers) to prevent failures. <sup>Written for commit a30a083d04d854bae7a91847e3c98ee31a4ec5f8. Summary will update on new commits.</sup> <!-- End of auto-generated description by cubic. --> --- <sub>🔄 This issue represents a GitHub Pull Request. It cannot be merged through Gitea due to API limitations.</sub>
GiteaMirror added the pull-request label 2026-04-15 22:09:38 -05:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: github-starred/better-auth#24068