Skip to main content
Module

x/mongo/mod.ts>Bson.ObjectId#toString

MongoDB driver for Deno
Extremely Popular
Go to Latest
method Bson.ObjectId.prototype.toString
import { Bson } from "https://deno.land/x/mongo@v0.31.2/mod.ts";
const { ObjectId } = Bson;

Converts the id into a 24 character hex string for printing, unless encoding is provided.

Parameters

optional
encoding: "hex" | "base64"
  • hex or base64

Returns

string