class Bson.UUID
extends Binary
import { Bson } from "https://deno.land/x/mongo@v0.31.2/mod.ts";
const { UUID } = Bson;
A class representation of the BSON UUID type.
Methods
inspect(): string
toHexString(includeDashes?: boolean): string
Returns the UUID id as a 32 or 36 character hex string representation, excluding/including dashes (defaults to 36 character dash separated)
toJSON(): string
Converts the id into its JSON string representation. A 36 character (dashes included) hex string in the format: xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx
toString(encoding?: "hex" | "base64"): string
Converts the id into a 36 character (dashes included) hex string, unless a encoding is specified.
Static Methods
createFromHexString(hexString: string): UUID
Creates an UUID from a hex string representation of an UUID.