-
-
Notifications
You must be signed in to change notification settings - Fork 3.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
updated array push type definition #10546
Conversation
index.d.ts
Outdated
@@ -1970,10 +1971,10 @@ declare module 'mongoose' { | |||
isMongooseArray: true; | |||
|
|||
/** Pushes items to the array non-atomically. */ | |||
nonAtomicPush(...args: any[]): number; | |||
nonAtomicPush(...args: T[]): number; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I'd make this AnyKeys<T> & AnyObject
instead of T[]
. Mongoose handles casting, so you don't necessarily have to push an instance of T
.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Hello,
I have made the changes you requested
Summary
Array Push Type accepts the T type parameter, it was any
Examples