import { type mongoose } from "https://deno.land/x/mongoose@8.6.4/types/index.d.ts";
const { ToObjectOptions } = mongoose;
Type Parameters
optional
THydratedDocumentType = HydratedDocument<unknown>Properties
if options.virtuals = true
, you can set options.aliases = false
to skip applying aliases. This option is a no-op if options.virtuals = false
.
optional
transform: boolean | ((doc: THydratedDocumentType,
ret: Record<string, any>,
options: ToObjectOptions<THydratedDocumentType>,
if set, mongoose will call this function to allow you to transform the returned object
if true, replace any conventionally populated paths with the original id in the output. Has no affect on virtual populated paths.
if true, convert Maps to POJOs. Useful if you want to JSON.stringify()
the result of toObject()
.
if true, convert any ObjectIds in the result to 24 character hex strings.