[PR #7925] [CLOSED] docs: add mongoose example to mongodb adapter docs #33230

Closed
opened 2026-04-17 23:53:08 -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: Closed

Base: mainHead: docs/mongoose-example


📝 Commits (2)

  • 1c66aea docs(mongo): add mongoose as alternative to native driver
  • fb6e948 Update docs/content/docs/adapters/mongo.mdx

📊 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 reuse (mongoose.connection.readyState), uses connection.getClient().db(), and shows mongodbAdapter in a full better-auth config (better-auth/adapters/mongodb).

Written for commit fb6e948803. 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:** ❌ Closed **Base:** `main` ← **Head:** `docs/mongoose-example` --- ### 📝 Commits (2) - [`1c66aea`](https://github.com/better-auth/better-auth/commit/1c66aea2ddd2c017825f9eeec38995a7a3c56c98) docs(mongo): add mongoose as alternative to native driver - [`fb6e948`](https://github.com/better-auth/better-auth/commit/fb6e948803e556129950efb2c0d9854e112f7b30) 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 reuse (`mongoose.connection.readyState`), uses `connection.getClient().db()`, and shows `mongodbAdapter` in a full `better-auth` config (`better-auth/adapters/mongodb`). <sup>Written for commit fb6e948803e556129950efb2c0d9854e112f7b30. 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-17 23:53:08 -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#33230