Skip to content

Commit 880bb2c

Browse files
authored
Merge pull request #14284 from Automattic/vkarpov15/gh-14282
types(query): add back `context` and `setDefaultsOnInsert` as Mongoose-specific query options
2 parents 8265b2e + fa00898 commit 880bb2c

File tree

2 files changed

+4
-0
lines changed

2 files changed

+4
-0
lines changed

test/types/queries.test.ts

+2
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

+2
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)