Scheduled trigger service returning undefined

I’m trying to create a scheduled trigger to clear a collection weekly, but I am unable to get the service…
const collection = context.services.get('mongodb-atlas'); is returning undefined when I log it to console, and when I try and using it, it just says “Cannot access member ‘db’ of undefined”. I’ve also tried setting the service name to “Cluster0” and “mongodb-datalake”, neither of which worked.

If someone could lend a hand on what I’m doing wrong and how I’m meant to do this, that would be awesome. Thanks.

Hi @Adam_Morris,

Welcome to the community.

You should place their a name of your linked atlas cluster service shown under linked clusters.

If you still have issues please provide the trigger url from the browser.

Thanks
Pavel