Hi everyone,
I’m experimenting Mongo Atlas Triggers. I need my Triggers function to list databases on the cluster it is running against.
I cannot find the way to do this, I tried the “Nodejs mongodb driver” way, something like :
const service = context.services.get("my-cluster");
const dbAdmin = service.db("admin").admin();
const listDb = await dbAdmin.listDatabases();
console.log(listDb.databases);
But I get the following error :
{“message”:“‘admin’ is not a function”,“name”:“TypeError”}
I thought the call to : context.services.get("my-cluster")
would gave me an object like the MongoClient object you get when we use the mongodb driver in a Node application but I’m certainly wrong here
Do you know if this is possible ?