[PR #7925] Docs/mongoose example #7630

Open
opened 2026-03-13 13:43:36 -05:00 by GiteaMirror · 0 comments
Owner

📋 Pull Request Information

Original PR: https://github.com/better-auth/better-auth/pull/7925
Author: @Dev-Ridwan16
Created: 2/11/2026
Status: 🔄 Open

Base: canaryHead: docs/mongoose-example


📝 Commits (3)

📊 Changes

1 file changed (+39 additions, -0 deletions)

View changed files

📝 docs/content/docs/adapters/mongo.mdx (+39 -0)

📄 Description

image

Add Mongoose example to MongoDB adapter documentation

Description
Adds a tabbed interface to the MongoDB adapter documentation showing both the native MongoDB driver and Mongoose as alternatives for connecting to MongoDB.

Motivation
Many developers prefer using Mongoose for MongoDB integration due to its schema validation and additional features. This PR provides clear examples for both approaches, making it easier for users to integrate Better Auth with their preferred MongoDB client.

Changes
Added tabs component to MongoDB adapter docs
Included Mongoose setup example with connection handling
Kept existing native driver example in first tab
Both examples show proper mongodbAdapter usage

Checklist

  • Documentation updated

  • Code formatted with BiomeJS

  • Changes follow contribution guidelines


Summary by cubic

Added a tabbed example to the MongoDB adapter docs for both the native driver and Mongoose. The Mongoose tab now includes dotenv-based connection setup with reuse (readyState check), uses connection.getClient().db(), and shows mongodbAdapter in a full betterAuth config.

Written for commit 4fd21d21066a43a87f1a7afc7ebf39418c952c12. 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/7925 **Author:** [@Dev-Ridwan16](https://github.com/Dev-Ridwan16) **Created:** 2/11/2026 **Status:** 🔄 Open **Base:** `canary` ← **Head:** `docs/mongoose-example` --- ### 📝 Commits (3) - [`1e2eb85`](https://github.com/better-auth/better-auth/commit/1e2eb8573a8adc866e379e8f6b23ad1540991bf7) docs(mongo): add mongoose as alternative to native driver - [`adf6d24`](https://github.com/better-auth/better-auth/commit/adf6d24eea49b4dce99c3916d11d3e7543a2835b) Merge branch 'canary' of https://github.com/better-auth/better-auth into docs/mongoose-example - [`4fd21d2`](https://github.com/better-auth/better-auth/commit/4fd21d21066a43a87f1a7afc7ebf39418c952c12) Update docs/content/docs/adapters/mongo.mdx ### 📊 Changes **1 file changed** (+39 additions, -0 deletions) <details> <summary>View changed files</summary> 📝 `docs/content/docs/adapters/mongo.mdx` (+39 -0) </details> ### 📄 Description <img width="1365" height="686" alt="image" src="https://github.com/user-attachments/assets/52c81e38-9779-4f9f-bfb2-ef67aae61160" /> ### Add Mongoose example to MongoDB adapter documentation **Description** Adds a tabbed interface to the MongoDB adapter documentation showing both the native MongoDB driver and Mongoose as alternatives for connecting to MongoDB. **Motivation** Many developers prefer using Mongoose for MongoDB integration due to its schema validation and additional features. This PR provides clear examples for both approaches, making it easier for users to integrate Better Auth with their preferred MongoDB client. **Changes** Added tabs component to MongoDB adapter docs Included Mongoose setup example with connection handling Kept existing native driver example in first tab Both examples show proper mongodbAdapter usage Checklist - [x] Documentation updated - [x] Code formatted with BiomeJS - [x] Changes follow contribution guidelines <!-- This is an auto-generated description by cubic. --> --- ## Summary by cubic Added a tabbed example to the MongoDB adapter docs for both the native driver and Mongoose. The Mongoose tab now includes dotenv-based connection setup with reuse (readyState check), uses connection.getClient().db(), and shows mongodbAdapter in a full betterAuth config. <sup>Written for commit 4fd21d21066a43a87f1a7afc7ebf39418c952c12. 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-03-13 13:43:36 -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#7630