Skip to content

Commit 13f8ce3

Browse files
committed
types: fix signature of DocumentArray.id
My main issue with this was that 'undefined' was a valid argument. Now it matches <https://mongoosejs.com/docs/api/documentarray.html#MongooseDocumentArray.prototype.id()>.
1 parent 2dda096 commit 13f8ce3

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

types/types.d.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,7 +70,7 @@ declare module 'mongoose' {
7070
create(obj: any): THydratedDocumentType;
7171

7272
/** Searches array items for the first document with a matching _id. */
73-
id(id: any): THydratedDocumentType | null;
73+
id(id: ObjectId | string | number | Buffer): THydratedDocumentType | null;
7474

7575
push(...args: (AnyKeys<T> & AnyObject)[]): number;
7676

0 commit comments

Comments
 (0)