Skip to content

Commit

Permalink
types(document): make document _id type default to unknown instead of…
Browse files Browse the repository at this point in the history
… any

Fix #14520
  • Loading branch information
vkarpov15 committed Apr 26, 2024
1 parent 5137eeb commit 03b7031
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion types/document.d.ts
Expand Up @@ -16,7 +16,7 @@ declare module 'mongoose' {
* * TQueryHelpers - Object with any helpers that should be mixed into the Query type
* * DocType - the type of the actual Document created
*/
class Document<T = any, TQueryHelpers = any, DocType = any> {
class Document<T = unknown, TQueryHelpers = any, DocType = any> {
constructor(doc?: any);

/** This documents _id. */
Expand Down
2 changes: 1 addition & 1 deletion types/types.d.ts
Expand Up @@ -83,7 +83,7 @@ declare module 'mongoose' {
class ObjectId extends mongodb.ObjectId {
}

class Subdocument<IdType = any, TQueryHelpers = any, DocType = any> extends Document<IdType, TQueryHelpers, DocType> {
class Subdocument<IdType = unknown, TQueryHelpers = any, DocType = any> extends Document<IdType, TQueryHelpers, DocType> {
$isSingleNested: true;

/** Returns the top level document of this sub-document. */
Expand Down

0 comments on commit 03b7031

Please sign in to comment.