Skip to content

Commit 06ddc42

Browse files
committed
types: address a couple of issues from #14228 code review
1 parent 89ddf14 commit 06ddc42

File tree

2 files changed

+3
-1
lines changed

2 files changed

+3
-1
lines changed

types/models.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -222,7 +222,7 @@ declare module 'mongoose' {
222222
/** Creates a `countDocuments` query: counts the number of documents that match `filter`. */
223223
countDocuments(
224224
filter?: FilterQuery<TRawDocType>,
225-
options?: (mongodb.CountOptions & MongooseSpecificQueryOptions) | null
225+
options?: (mongodb.CountOptions & Omit<MongooseSpecificQueryOptions, 'lean' | 'timestamps'>) | null
226226
): QueryWithHelpers<
227227
number,
228228
THydratedDocumentType,

types/query.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ declare module 'mongoose' {
110110
* aren't explicitly allowed using `mongoose.trusted()`.
111111
*/
112112
sanitizeFilter?: boolean;
113+
/* Set to `true` to automatically sanitize potentially unsafe user-generated query projections */
114+
sanitizeProjection?: boolean;
113115
setDefaultsOnInsert?: boolean;
114116
/** overwrites the schema's strict mode option */
115117
strict?: boolean | string;

0 commit comments

Comments
 (0)