Options
All
  • Public
  • Public/Protected
  • All
Menu

Hierarchy

  • ToObjectOptions

Index

Properties

getters?: boolean

apply all getters (path and virtual getters)

virtuals?: boolean | string[]

apply virtual getters (can override getters option)

aliases?: boolean

if options.virtuals = true, you can set options.aliases = false to skip applying aliases. This option is a no-op if options.virtuals = false.

minimize?: boolean

remove empty objects (defaults to true)

transform?: boolean | ((doc: any, ret: any, options: any) => any)

if set, mongoose will call this function to allow you to transform the returned object

depopulate?: boolean

if true, replace any conventionally populated paths with the original id in the output. Has no affect on virtual populated paths.

versionKey?: boolean

if false, exclude the version key (__v by default) from the output

flattenMaps?: boolean

if true, convert Maps to POJOs. Useful if you want to JSON.stringify() the result of toObject().

useProjection?: boolean

If true, omits fields that are excluded in this document's projection. Unless you specified a projection, this will omit any field that has select: false in the schema.

Generated using TypeDoc