Aggregation pipeline in data api

Hi,

I am trying to execute a pipeline via the data api with api-key auth and I am getting this error:

Failed to aggregate documents: FunctionError: aggregation stage "$geoNear" is not supported in a user context. A pipeline with this stage must be run as a System User

The api key is User Type:server tho. Has anyone else experience this?

@Michael_Murray4 Based on the provided log, it appears that the problem may be related to the role or permissions of the user you are currently using…