-
Type: Bug
-
Resolution: Fixed
-
Priority: Unknown
-
Affects Version/s: None
-
Component/s: None
-
Empty show more show less
-
Not Needed
What problem are you facing?
The 4.0.1 TS typings' overloaded declarations for Collection.rename() has a | void on the return type of an overload that should only return a Promise. If a method returns a Promise, it should never also be typed | void. The problem doesn't show up in any other overload declarations, so I assume this was just a bug, not an implied assertion about weird behavior of this method.
I opened a PR to fix it: https://github.com/mongodb/node-mongodb-native/pull/2922
Code is here: https://github.com/mongodb/node-mongodb-native/blob/dc6e2d6c5762ec62d1096a52d670b76b02aa2bf3/src/collection.ts#L624
Expected:
rename(newName: string, options: RenameOptions): Promise<Collection> | void;
Actual:
rename(newName: string, options: RenameOptions): Promise<Collection>;
What driver and relevant dependency versions are you using?
4.0.1
Steps to reproduce?
See https://github.com/mongodb/node-mongodb-native/pull/2922