Skip to content

Docs :: Add guidance on using loadClass with Typescript #12813

Open

Description

Prerequisites

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

🚀 Feature Proposal

I'm trying to port a JS project that uses loadClass to TS (it's doing my head in trying to get types working completely ..). The documentation on TS is good enough, except doesn't mention anything about loadClass. A basic example showing how to use it with Mongoose's typings, or alternatively, a statement recommending against its use, and briefly why would be helpful.

Aside: the fundamental class structure implied by loadClass seems to be at odds with Mongoose's actual class structure. Maybe this wasn't a problem in JS work, but it's definitely, at the least, a bit confusing in TS world. Maybe loadClass should be deprecated.

Motivation

Help users trying to decide whether to try shoehorn loadClass into Mongoose typings or not.

Example

No response

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    developer-experienceThis issue improves error messages, debugging, or reportingdocsThis issue is due to a mistake or omission in the mongoosejs.com documentationenhancementThis issue is a user-facing general improvement that doesn't fix a bug or add a new featuretypescriptTypes or Types-test related issue / Pull Request

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions