Skip to main content
Deno 2 is finally here 🎉️
Learn more
Go to Latest
method ObjectId.isValid
import { ObjectId } from "https://deno.land/x/darkflare@v7.2.2/realm/mod.ts";

Checks if a value is a valid bson ObjectId

Parameters

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

Returns

boolean