Skip to main content
The Deno 2 Release Candidate is here
Learn more
Module

x/hex/src/lib/data/deps.ts>mongo.Credential

An ecosystem delivering practices, philosophy and portability. Powered By Deno and JavaScript.
Latest
interface mongo.Credential
import { type mongo } from "https://deno.land/x/hex@0.6.5/src/lib/data/deps.ts";
const { Credential } = mongo;

Properties

optional
username: string

The username to authenticate with. This applies to all mechanisms but may be omitted when authenticating via MONGODB-X509.

optional
password: string

The password to authenticate with. This does not apply to all mechanisms.

optional
db: string

The database used to authenticate. This applies to all mechanisms and defaults to "admin" in SCRAM authentication mechanisms and "$external" for GSSAPI, MONGODB-X509 and PLAIN.

optional
mechanism: "SCRAM-SHA-1" | "SCRAM-SHA-256" | "MONGODB-X509"

Which authentication mechanism to use. If not provided, one will be negotiated with the server.