Saving an aggregation query using \"mongodb\": \"^3.0.6\" as result with the $out operator is only working when calling .toArray().
\"mongodb\": \"^3.0.6\"
$out
.toArray()
Because the Aggregation operation returns a cursor, not the results. In order to return all the documents from the cursor, we need to use toArray method.