UNPKG

mongoose-lean-defaults

Version:

Attach defaults to the results of mongoose queries when using `.lean()`

7 lines (6 loc) 419 B
import { Schema, Query, Document } from 'mongoose'; export interface MongooseLeanDefaultsOptions { defaults?: boolean; } export default function mongooseLeanDefaults(schema: Schema<any, any, any, any>, options?: MongooseLeanDefaultsOptions): void; export declare function attachDefaults(this: Query<unknown, Document>, schema: Schema, res: unknown, options?: MongooseLeanDefaultsOptions, prefix?: string): unknown;