Skip to content

Commit 7798bad

Browse files
committed
types: add schemaLevelProjections to types re: Automattic#11474
1 parent a5fedd3 commit 7798bad

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

types/query.d.ts

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ declare module 'mongoose' {
2424
| 'runValidators'
2525
| 'sanitizeProjection'
2626
| 'sanitizeFilter'
27+
| 'schemaLevelProjections'
2728
| 'setDefaultsOnInsert'
2829
| 'strict'
2930
| 'strictQuery'
@@ -179,6 +180,11 @@ declare module 'mongoose' {
179180
* aren't explicitly allowed using `mongoose.trusted()`.
180181
*/
181182
sanitizeFilter?: boolean;
183+
/**
184+
* Enable or disable schema level projections for this query. Enabled by default.
185+
* Set to `false` to include fields with `select: false` in the query result by default.
186+
*/
187+
schemaLevelProjections?: boolean;
182188
setDefaultsOnInsert?: boolean;
183189
skip?: number;
184190
sort?: any;
@@ -734,6 +740,12 @@ declare module 'mongoose' {
734740
*/
735741
sanitizeProjection(value: boolean): this;
736742

743+
/**
744+
* Enable or disable schema level projections for this query. Enabled by default.
745+
* Set to `false` to include fields with `select: false` in the query result by default.
746+
*/
747+
schemaLevelProjections(value: boolean): this;
748+
737749
/** Specifies which document fields to include or exclude (also known as the query "projection") */
738750
select<RawDocTypeOverride extends { [P in keyof RawDocType]?: any } = {}>(
739751
arg: string | string[] | Record<string, number | boolean | string | object>

0 commit comments

Comments
 (0)