Skip to main content
Module

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

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

There may be a better way to do this, but the goal is to return the DocType if it can be infered and if not to return a type which is easily identified as "not valid" so we fall back to "strip out known things added by extending Document" There are three basic ways to mix in Document -- "Document & T", "Document<ObjId, mixins, T>", and "T extends Document". In the last case there is no type without Document mixins, so we can only strip things out. In the other two cases we can infer the type, so we should