flow-typed
flow-typed copied to clipboard
Mongoose populate
set the correct return type for Mongoose$Document.popluate()
(https://github.com/Automattic/mongoose/blob/4545d44c56a1fe62fa21d783b70bb3a8ff1734cd/lib/document.js#L2483)
Hi @maxaggedon! Looks like the libdef is failing on 0.85.0. The reason is that 0.85.0 is much stricter with type annotations, see: https://medium.com/flow-type/asking-for-required-annotations-64d4f9c1edf8
Would you be willing to fix those issues too?
Hi @villesau ! I did the same fixes for v5 ;)
Callback-version of Document#populate is not purposed to return anything at all. So, imo, it would be better and cleaner to add a separate definition to callback-less version, like this one:
populate(path: string): this;