I am writing a function for an Atlas Trigger and I have decided to use Node.js runtime environment to write this function. To start I am trying to connect to the cluster using the following command: “context.services.get(<SERVICE_NAME>)”. However, this method is only returning “{“version”:1}”. So when I attempt to connect to the db with the result using context.services.get(<SERVICE_NAME>).db(‘db_name’), it returns an empty object {}.
I have updated the Service Name and the DB Name to match the one in our setup. Any idea on why I am unable to properly access the cluster?
While we’re here I also want to ask if any of this setup is necessary for my use case. I am writing this scheduled trigger to scan a collection for records with a Due Date that match the current time. Upon locating a document that matches the criteria, it will update the status.