Options
All
  • Public
  • Public/Protected
  • All
Menu

Interface QueryOptions<DocType>

Type Parameters

  • DocType = unknown

Hierarchy

Indexable

[other: string]: any

Index

Properties

populate?: string | string[] | PopulateOptions | PopulateOptions[]
arrayFilters?: {}[]
batchSize?: number
collation?: CollationOptions
comment?: any
context?: string
fields?: any
hint?: Hint
lean?: any

If truthy, mongoose will return the document as a plain JavaScript object rather than a mongoose document.

limit?: number
maxTimeMS?: number
maxscan?: number
multi?: boolean
multipleCastError?: boolean
new?: boolean

By default, findOneAndUpdate() returns the document as it was before update was applied. If you set new: true, findOneAndUpdate() will instead give you the object after update was applied.

overwrite?: boolean
overwriteDiscriminatorKey?: boolean
projection?: ProjectionType<DocType>
rawResult?: boolean

if true, returns the raw result from the MongoDB driver

readPreference?: string
returnOriginal?: boolean

An alias for the new option. returnOriginal: false is equivalent to new: true.

returnDocument?: string

Another alias for the new option. returnOriginal is deprecated so this should be used.

runValidators?: boolean
sanitizeProjection?: boolean
sanitizeFilter?: boolean

Set to true to automatically sanitize potentially unsafe query filters by stripping out query selectors that aren't explicitly allowed using mongoose.trusted().

setDefaultsOnInsert?: boolean
skip?: number
snapshot?: any
sort?: any
strict?: string | boolean

overwrites the schema's strict mode option

strictQuery?: boolean | "throw"

equal to strict by default, may be false, true, or 'throw'. Sets the default strictQuery mode for schemas.

tailable?: number
timestamps?: boolean | QueryTimestampsConfig

If set to false and schema-level timestamps are enabled, skip timestamps for this update. Note that this allows you to overwrite timestamps. Does nothing if schema-level timestamps are not set.

upsert?: boolean
writeConcern?: WriteConcern
session?: ClientSession

Generated using TypeDoc