method IMongoObjectIdCtor.isValid
IMongoObjectIdCtor.isValid(value: unknown): boolean

Tests whether a value is a valid ObjectId — exactly a 24-hex string, so a 12-char value is rejected.

Parameters

value: unknown

The candidate value

Return Type

boolean

Usage

import { type IMongoObjectIdCtor } from "database-plugin/src/index.ts";