Skip to main content
Deno 2 is finally here 🎉️
Learn more
Module

x/hex/src/data/deps.ts>mongo.Bson.ObjectId.isValid

An ecosystem delivering practices, philosophy and portability.
Go to Latest
method mongo.Bson.ObjectId.isValid
Re-export
import { mongo } from "https://deno.land/x/hex@0.5.15/src/data/deps.ts";
const { ObjectId } = mongo.Bson;

Checks if a value is a valid bson ObjectId

Parameters

id:
| string
| number
| Uint8Array
  • ObjectId instance to validate.

Returns

boolean