From c31e5f331684e95f53b29f4586378cb4e5680256 Mon Sep 17 00:00:00 2001 From: Gregor Yushinov Date: Fri, 13 Oct 2017 03:13:21 +0200 Subject: [PATCH] Added eachAsync options for concurrency --- types/mongoose/index.d.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/types/mongoose/index.d.ts b/types/mongoose/index.d.ts index cd7bb438d4..602b700958 100644 --- a/types/mongoose/index.d.ts +++ b/types/mongoose/index.d.ts @@ -469,6 +469,11 @@ declare module "mongoose" { static Messages: Object; } + interface EachAsyncOptions { + /** defaults to 1 */ + parallel?: number; + } + /* * section querycursor.js * http://mongoosejs.com/docs/api.html#querycursor-js @@ -502,7 +507,7 @@ declare module "mongoose" { * Returns a promise that resolves when done. * @param callback executed when all docs have been processed */ - eachAsync(fn: (doc: T) => any, callback?: (err: any) => void): Promise; + eachAsync(fn: (doc: T) => any, options: EachAsyncOptions, callback?: (err: any) => void): Promise; /** * Registers a transform function which subsequently maps documents retrieved