I have a query to our DB that was working until yesterday, using the aggregate
endpoint for Data API. https://data.mongodb-api.com/app/data-{app_id}/endpoint/data/beta/action/aggregate
It has a $merge
stage in this aggregation pipeline.
This query was working just fine in both our prod and staging environments for several weeks until yesterday. It now fails with the following error:
“Failed to aggregate documents: FunctionError: aggregation stage “$merge” is not supported in a user context. A pipeline with this stage must be run as a System User”
We have changed nothing on our end. Could you please advise on how to either make our Data API token run as a system user or how to run an aggregation pipeline now using the Data API?
Thank you.