A scheduled trigger I setup in Atlas to aggregate our data and merge it into a “clean” collection is not working - it says success, but no documents get added to the clean collection. The aggregation when I run it directly on the collection. Any ideas why it isn’t working?
Difficult to say, without looking at the code… The usual mistake there is that the aggregation (that returns a cursor) is never run because it needs either a .next() or .toArray() at the end (that launches the process and returns a Promise - see the Note)
I found the cause - in the function settings I needed to change Authentication from “Application Authentication” to “System”.
You probably had some aggregation stages that required System privileges, then, like $out or $merge