List Database in Mongo Atlas Triggers

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 ="my-cluster");
  const dbAdmin = service.db("admin").admin();
  const listDb = await dbAdmin.listDatabases();

But I get the following error :

{“message”:"‘admin’ is not a function",“name”:“TypeError”}

I thought the call to :"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 :slight_smile:

Do you know if this is possible ?

Just found this thread, so it seems it is not possible… :slight_smile:

This topic was automatically closed 5 days after the last reply. New replies are no longer allowed.