> error: TypeError: Cannot access member 'db' of undefined

exports = function(arg){
var collection = context.services.get(“Cluster0”).db(“Database”).collection(“alldata”);

return collection.find({});
};

error:
TypeError: Cannot access member ‘db’ of undefined

I keep getting this error. How can I fix this?

I’ve also tried “mongo-atlas” too.

Check this link

Hi @tkdgy_dl ,

You should try mongodb-atlas instead.

If that doesn’t work can you go into function UI and copy paste the URL in the browser here

Thanks
Pavel

1 Like