diff --git a/types/models.d.ts b/types/models.d.ts index a3e315ad05b..e74754f0710 100644 --- a/types/models.d.ts +++ b/types/models.d.ts @@ -32,7 +32,9 @@ declare module 'mongoose' { PopulateOption, SessionOption { limit?: number; + // @deprecated, use includeResultMetadata instead rawResult?: boolean; + includeResultMetadata?: boolean; ordered?: boolean; lean?: boolean; throwOnValidationError?: boolean; diff --git a/types/query.d.ts b/types/query.d.ts index 3963481a20b..1d66e75221c 100644 --- a/types/query.d.ts +++ b/types/query.d.ts @@ -124,9 +124,14 @@ declare module 'mongoose' { overwriteDiscriminatorKey?: boolean; projection?: ProjectionType; /** + * @deprecated use includeResultMetadata instead. * if true, returns the raw result from the MongoDB driver */ rawResult?: boolean; + /** + * if ture, includes meta data for the result from the MongoDB driver + */ + includeResultMetadata?: boolean; readPreference?: string | mongodb.ReadPreferenceMode; /** * An alias for the `new` option. `returnOriginal: false` is equivalent to `new: true`.