import { mongoose } from "https://deno.land/x/mongoose@8.4.3/types/index.d.ts";
const { Schema } = mongoose;
Constructors
Create a new schema
Type Parameters
Properties
Array of child schemas (from document arrays and single nested subdocs)
and their corresponding compiled models. Each element of the array is
an object with 2 properties: schema
and model
.
Object containing discriminators defined on this schema
Object of currently defined methods on this schema.
Object of currently defined statics on this schema.
Methods
Adds key path / schema type pairs to this schema.
Add an alias for path
. This means getting or setting the alias
is equivalent to getting or setting the path
.
Iterates the schemas paths similar to Array#forEach.
Defines an index (most likely compound) for this schema.
Returns a list of indexes that this schema declares, via schema.index()
or by index: true
in a path's options.
Loads an ES6 class into a schema. Maps setters + getters, static methods, and instance methods to schema virtuals, statics, and methods.
Adds an instance method to documents constructed from Models compiled from this schema.
Returns a new schema that has the paths
from the original schema, minus the omitted ones.
Gets/sets schema paths.
Returns a new schema that has the picked paths
from this schema.
Registers a plugin for this schema.
Defines a post hook for the model.
Defines a pre hook for the model.
Returns an Array of path strings that are required by this schema.
Sets a schema option.
Adds static "class" methods to Models compiled from this schema.
Creates a virtual type with the given name.
Returns the virtual type with the given name
.