Skip to content

Update Mongoose to 4.0 #4773

Closed
Closed

Description

@MrKomish

Please, add type definition for mongoose 4.0.

Activity

  1. pocesar commented on Jul 12, 2015

    @pocesar
    Contributor

    current mongoose implementation is really permissive, and hard to extend properly. IMHO it would have to be refactored to account for the typesafety that TS provides, but it would be a breaking change. I'm interested in this as well, and would be willing to give it a try, create two typings, mongoose and mongoose-legacy

  2. davidlondono commented on Sep 23, 2015

    @davidlondono

    +1

  3. aleh-op commented on Oct 15, 2015

    @aleh-op

    The guy who implemented previous version is not going to refactor it. I check his activity on github and he is absent for a long time.

    So i think that, we should implement new version on our own.

  4. dominikkukacka commented on Jan 25, 2016

    @dominikkukacka

    is there any news about this?

  5. pocesar commented on Jan 26, 2016

    @pocesar
    Contributor

    just like new lodash, I think this needs a joint task force. the new lodash (4.x) definitions are superb btw, hinting just works(tm) https://github.com/DefinitelyTyped/DefinitelyTyped/blob/master/lodash/lodash.d.ts
    IMHO it's a benchmark of how good a typings definition is, being the highest tier

    notice the "checkmarks" in header, it's a hacky (but clever) way to get this done and keep track of progress

  6. stevehipwell commented on Feb 17, 2016

    @stevehipwell
    Contributor

    Do you have any news? Promise is broken if you want to use catch, will this be fixed?

  7. pocesar commented on Mar 13, 2016

    @pocesar
    Contributor

    yeah, the promise.catch problem happened to me as well, and it's hard to extend the defined interfaces and classes in this typing. also most of the functions are missing their promise returns, like save(), populate(), execPopulate(), etc
    had to manually edit the mongoose.d.ts to import bluebird to the typings file so I could use it in mongoose.Promise = Bluebird because there's no easy way around, extending the interfaces are useless

  8. tomwanzek commented on May 16, 2016

    @tomwanzek
    Contributor

    +1
    Is there any work in progress on updating the mongoose.d.ts? Similar to @pocesar I ended up manually adding supplementary type definitions for MongooseArray and MongooseDocumentArray to use in model definitions, as they are completely missing from the current mongoose definition.

    Also, this issue seems to overlap with #4262.

  9. simon-xiong-ca commented on Jul 4, 2016

    @simon-xiong-ca
    Contributor

    Hey everyone, I've started working on an updated Definition for v4 here: https://github.com/simonxca/DefinitelyTyped/blob/mongoose4/mongoose/mongoose.d.ts

    Still a long way to go, but I'm interested in suggestions on how to manage the breaking changes from v3 to v4.

  10. 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

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions