Skip to content

Export types to be able to extend from the Mongoose class #12456

Open
@nivida

Description

@nivida

Prerequisites

  • I have written a descriptive issue title
  • I have searched existing issues to ensure the bug has not already been reported

Mongoose version

6.6.1

Node.js version

18.x

MongoDB server version

5.x

Description

Currently the type definitions only export mongoose as module but don't allow to import the actual Mongoose class so that we can extend in TS from.

Steps to Reproduce

import {Mongoose} from 'mongoose'

export class Database extends Mongoose {
  ....

  public async connect(): Promise<boolean> {
    ...
    
    await supper.connect(...);
    return true;
  }
}

Expected Behavior

I'm able to extend the base Mongoose class within TypeScript.

Metadata

Metadata

Assignees

No one assigned

    Labels

    typescriptTypes or Types-test related issue / Pull Request

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions