I have an Atlas function where I try to create a collection:
exports = async function(arg){
var atlas = context.services.get(“mongodb-atlas”)
var db = atlas.db(“one”);
db.createCollection(“test”)
};
But I get
error: {“message”:“‘createCollection’ is not a function”,“name”:“TypeError”}
Could it be that the database object does not allow creating collections when I’m in an Atlas function? Its stringification looks like {“collection”:{},“aggregate”:{},“getCollectionNames”:{}} . Are these three things all I can do from within an atlas function?