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.
Go to Latest
class mongoose.VirtualType
import { mongoose } from "https://deno.land/x/mongoose@8.6.3/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.