Skip to content

Commit 646a419

Browse files
Longboyysamualtnorman
authored andcommitted
Fix broken $addToSet typing
1 parent 3988b0d commit 646a419

File tree

1 file changed

+2
-5
lines changed

1 file changed

+2
-5
lines changed

env.d.ts

Lines changed: 2 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -772,10 +772,6 @@ type Projection<Schema extends MongoSchema> = Partial<{
772772
[key in keyof Schema]: boolean | 0 | 1
773773
}>
774774

775-
/*
776-
rename
777-
addToSet
778-
*/
779775

780776
type MongoUpdateOperators<Schema extends MongoSchema> = Partial<{
781777
/* Universal operators */
@@ -807,7 +803,8 @@ type MongoUpdateOperators<Schema extends MongoSchema> = Partial<{
807803
| MongoUpdateArrayOperatorModifiers<Schema[key]>
808804
}>
809805
$addToSet: Partial<Record<string, MongoCommandValue> & {
810-
[key in keyof Schema as Schema[key] extends Array<infer U> ? key : never]: Schema[key] | MongoUpdateArrayOperatorUniversalModifiers<Schema[key]>
806+
[key in keyof Schema as Schema[key] extends Array<infer U> ? key : never]: (Schema[key] extends (infer U)[] ? U : never)
807+
| MongoUpdateArrayOperatorUniversalModifiers<Schema[key]>
811808
}>
812809
$pull: Partial<Record<string, MongoCommandValue> & {
813810
[key in keyof Schema as Schema[key] extends Array<infer U> ? key : never]: (Schema[key] extends (infer U)[] ? U : never)

0 commit comments

Comments
 (0)