import { mongoose } from "https://deno.land/x/mongoose@7.8.2/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.
The original object passed to the schema constructor
Object of currently defined query helpers on this schema.
Object of currently defined statics on this schema.
Object of currently defined virtuals 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
.
Removes all indexes on this schema
Returns a copy of this schema
Iterates the schemas paths similar to Array#forEach.
Gets a schema option.
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.
Gets/sets schema paths.
Returns the pathType of path
for this schema.
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.
Adds a method call to the queue.
Removes the given path
(or [paths
]).
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
.