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

x/mongoose/types/index.d.ts>mongoose.Schema#virtual

MongoDB object modeling designed to work in an asynchronous environment.
Go to Latest
method mongoose.Schema.prototype.virtual
import { mongoose } from "https://deno.land/x/mongoose@6.13.0/types/index.d.ts";
const { Schema } = mongoose;

Creates a virtual type with the given name.

Type Parameters

optional
T = HydratedDocument<DocType, TInstanceMethods, TVirtuals>

Parameters

name: keyof TVirtuals | string
optional
options: VirtualTypeOptions<T, DocType>