Interface QueryOptions<DocType>

Type Parameters

  • DocType = unknown

Hierarchy

Indexable

[other: string]: any

Properties

arrayFilters?: {
    [key: string]: any;
}[]

Type declaration

  • [key: string]: any
batchSize?: number
collation?: CollationOptions
comment?: any
context?: string
fields?: any
hint?: Hint
includeResultMetadata?: boolean

if ture, includes meta data for the result from the MongoDB driver

lean?: boolean | Record<string, any>

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

limit?: number
maxTimeMS?: 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.

overwriteDiscriminatorKey?: boolean
populate?: string | string[] | PopulateOptions | PopulateOptions[]
projection?: ProjectionType<DocType>
rawResult?: boolean

Deprecated

use includeResultMetadata instead. if true, returns the raw result from the MongoDB driver

readPreference?: string
returnDocument?: "before" | "after"

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

returnOriginal?: boolean

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

runValidators?: boolean

Set to true to enable update validators (https://mongoosejs.com/docs/validation.html#update-validators). Defaults to false.

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().

sanitizeProjection?: boolean
setDefaultsOnInsert?: boolean
skip?: number
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.

translateAliases?: boolean

If true, convert any aliases in filter, projection, update, and distinct to their database property names. Defaults to false.

upsert?: boolean
useBigInt64?: boolean
writeConcern?: mongoose.mongo.WriteConcern

Generated using TypeDoc