Skip to content

Commit

Permalink
types(query): add back context and setDefaultsOnInsert as Mongoos…
Browse files Browse the repository at this point in the history
…e-specific query options

Fix #14282
  • Loading branch information
vkarpov15 committed Jan 23, 2024
1 parent 8265b2e commit fa00898
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 fa00898

Please sign in to comment.