/** *
* * ## Installation * * ```bash npm2yarn * npm install @auth/mongodb-adapter mongodb * ``` * * @module @auth/mongodb-adapter */ import { ObjectId } from "mongodb"; import type { Adapter } from "@auth/core/adapters"; import type { MongoClient } from "mongodb"; /** This is the interface of the MongoDB adapter options. */ export interface MongoDBAdapterOptions { /** * The name of the {@link https://www.mongodb.com/docs/manual/core/databases-and-collections/#collections MongoDB collections}. */ collections?: { Users?: string; Accounts?: string; Sessions?: string; VerificationTokens?: string; }; /** * The name you want to give to the MongoDB database */ databaseName?: string; /** * Callback function for managing the closing of the MongoDB client. * This could be useful when `client` is provided as a function returning MongoClient. * It allows for more customized management of database connections, * addressing persistence, container reuse, and connection closure issues. */ onClose?: (client: MongoClient) => Promise