Interface PopulateOptions

Hierarchy

  • PopulateOptions

Properties

foreignField?: string

Overwrite the schema-level foreign field to populate on if this is a populated virtual.

justOne?: boolean

If true Mongoose will always set path to a document, or null if no document was found. If false Mongoose will always set path to an array, which will be empty if no documents are found. Inferred from schema by default.

localField?: string

Overwrite the schema-level local field to populate on if this is a populated virtual.

match?: any

query conditions to match

model?: string | mongoose.Model<any, {}, {}, {}, any, any>

optional model to use for population

options?: mongoose.QueryOptions<unknown>

optional query options like sort, limit, etc

path: string

space delimited path(s) to populate

perDocumentLimit?: number

correct limit on populated array

populate?: string | PopulateOptions | (string | PopulateOptions)[]

deep populate

select?: any

fields to select

strictPopulate?: boolean

optional boolean, set to false to allow populating paths that aren't in the schema

transform?: ((doc, id) => any)

Type declaration

    • (doc, id): any
    • transform function to call on every populated doc

      Parameters

      • doc: any
      • id: any

      Returns any

Generated using TypeDoc