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

x/mongoose/types/index.d.ts>mongoose.VirtualType

MongoDB object modeling designed to work in an asynchronous environment.
Latest
class mongoose.VirtualType
import { mongoose } from "https://deno.land/x/mongoose@6.13.4/types/index.d.ts";
const { VirtualType } = mongoose;

Type Parameters

HydratedDocType

Methods

applyGetters(value: any, doc: Document): any

Applies getters to value.

applySetters(value: any, doc: Document): any

Applies setters to value.

get<T = HydratedDocType>(fn: (
this: T,
value: any,
virtualType: VirtualType<T>,
doc: T,
) => any
): this

Adds a custom getter to this virtual.

set<T = HydratedDocType>(fn: (
this: T,
value: any,
virtualType: VirtualType<T>,
doc: T,
) => void
): this

Adds a custom setter to this virtual.