path in depopulate is not required

You can call depopulate with no parameters and it will depopulate all populated fields on the document.
https://github.com/Automattic/mongoose/issues/6075
This commit is contained in:
Thomas Rayden
2018-10-17 19:00:29 +08:00
committed by GitHub
parent bbf1adeeac
commit 335ce7d2d6
+1 -1
View File
@@ -1119,7 +1119,7 @@ declare module "mongoose" {
* Takes a populated field and returns it to its unpopulated state.
* If the path was not populated, this is a no-op.
*/
depopulate(path: string): this;
depopulate(path?: string): this;
/**
* Returns true if the Document stores the same data as doc.