Skip to content

Commit fa00898

Browse files
committed
types(query): add back context and setDefaultsOnInsert as Mongoose-specific query options
Fix #14282
1 parent 8265b2e commit fa00898

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

test/types/queries.test.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -553,11 +553,13 @@ function mongooseQueryOptions() {
553553
{ name: 'bar' },
554554
{ name: 'baz' },
555555
{
556+
context: 'query',
556557
multipleCastError: true,
557558
overwriteDiscriminatorKey: true,
558559
runValidators: true,
559560
sanitizeProjection: true,
560561
sanitizeFilter: true,
562+
setDefaultsOnInsert: true,
561563
strict: true,
562564
strictQuery: 'throw',
563565
timestamps: false,

types/query.d.ts

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -19,13 +19,15 @@ declare module 'mongoose' {
1919

2020
type MongooseQueryOptions<DocType = unknown> = Pick<
2121
QueryOptions<DocType>,
22+
'context' |
2223
'lean' |
2324
'multipleCastError' |
2425
'overwriteDiscriminatorKey' |
2526
'populate' |
2627
'runValidators' |
2728
'sanitizeProjection' |
2829
'sanitizeFilter' |
30+
'setDefaultsOnInsert' |
2931
'strict' |
3032
'strictQuery' |
3133
'timestamps' |

0 commit comments

Comments
 (0)