From 335ce7d2d64696b7901e63e621c1c4ced3b3004b Mon Sep 17 00:00:00 2001 From: Thomas Rayden Date: Wed, 17 Oct 2018 19:00:29 +0800 Subject: [PATCH] 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 --- types/mongoose/index.d.ts | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index 19551684e0..300a0da6f8 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -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.