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

x/denodb/deps.ts>Bson.ObjectId.isValid

MySQL, SQLite, MariaDB, PostgreSQL and MongoDB ORM for Deno
Go to Latest
method Bson.ObjectId.isValid
import { Bson } from "https://deno.land/x/denodb@v1.1.0/deps.ts";
const { ObjectId } = Bson;

Checks if a value is a valid bson ObjectId

Parameters

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

Returns

boolean