Skip to content

mongoose Document should be a class not an interface #6957

Closed

Description

@sebastianwahn

Recommendation

The mongoose.d.ts Document should be a class and not an interface, since mongoose has an implementation for Document (lib/document.js).

export interface Document { ... }

should be
export class Document { ... }

Use Case:

I try to implement a generic Repository<T extends Document>
Then i create a class Model extends Document { ... }

Now according (with export interface Document { ... }) i have to implement all functions which are already provided by mongoose.
With export class Document { ... } they are already provided by mongoose like it is the case

Activity

  1. vvakame commented on Dec 1, 2015

    @vvakame
    Member

    please send a pull request with document url.

  2. added a commit that references this issue on Jan 22, 2026
    c6757a1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions