I have gone through the official Atlas documentation but couldn't find this. Although in the MongoDB manual documentation I came across db.getCollectionNames() but it is also not working for me.
I am getting this error,
TypeError: 'getCollectionNames' is not a function
Please check out the following function and suggest me how I can get the desired result.
exports = function () {
let collections = context.services.get("mongodb-atlas").db("messages").getCollectionNames();
return collections;
};