I have updated mongo and now in the log the following error appears: Use of the aggregate command without the cursor option is deprecated
Mo
From the latest MongoDB manual the aggregate operation have changed.
aggregate without cursor
MongoDB 3.4 deprecates the use of aggregate command without the cursor option, unless the pipeline includes the explain option. When returning aggregation results inline using the aggregate command, specify the cursor option using the default batch size cursor: {} or specify the batch size in the cursor option cursor: { batchSize: }.
You can just specify that parameter for your function call with adding [ "cursor" => [ "batchSize" => 0 ] ]
as the second parameter will solve this. refer here.
You can also refer to this SO question for the cursor parameter usage.