Mongodb driver not working

I was looking to send data to another cluster using atlas function associated with trigger. I imported mongodb driver as dependency to connect to another cluster and getting error that it’s not supported. Please advise

Hi, there is no need to import the driver. We support most operations natively in the function engineer. Please see here for more details: https://www.mongodb.com/docs/atlas/app-services/functions/mongodb/#query-mongodb-atlas

Can you give me example to connect to another cluster in another project. I have one cluster in one project, where I have db trigger with function and cosing this function to update /insert/delete documents in collection/collections in another project’s cluster collection.

That is not possible currently due to permissions issues. If you need to do this, we would recommend either hitting an external API or perhaps setting up Data API (https://www.mongodb.com/docs/atlas/app-services/data-api/) and having the function hit that.