Skip to content

Commit

Permalink
Merge pull request #14284 from Automattic/vkarpov15/gh-14282
Browse files Browse the repository at this point in the history
types(query): add back `context` and `setDefaultsOnInsert` as Mongoose-specific query options
  • Loading branch information
vkarpov15 committed Jan 23, 2024
2 parents 8265b2e + fa00898 commit 880bb2c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 0 deletions.
2 changes: 2 additions & 0 deletions test/types/queries.test.ts
Expand Up @@ -553,11 +553,13 @@ function mongooseQueryOptions() {
{ name: 'bar' },
{ name: 'baz' },
{
context: 'query',
multipleCastError: true,
overwriteDiscriminatorKey: true,
runValidators: true,
sanitizeProjection: true,
sanitizeFilter: true,
setDefaultsOnInsert: true,
strict: true,
strictQuery: 'throw',
timestamps: false,
Expand Down
2 changes: 2 additions & 0 deletions types/query.d.ts
Expand Up @@ -19,13 +19,15 @@ declare module 'mongoose' {

type MongooseQueryOptions<DocType = unknown> = Pick<
QueryOptions<DocType>,
'context' |
'lean' |
'multipleCastError' |
'overwriteDiscriminatorKey' |
'populate' |
'runValidators' |
'sanitizeProjection' |
'sanitizeFilter' |
'setDefaultsOnInsert' |
'strict' |
'strictQuery' |
'timestamps' |
Expand Down

0 comments on commit 880bb2c

Please sign in to comment.