Is there a way to create a collection in MongoDB stitch app in react-native. I tried the normal MongoDB way
const stitchClient = Stitch.getAppClient(myAppID);
const mongodb = stitchClient.getServiceClient(RemoteMongoClient.factory, "mongodb-atlas")
.db("ToDo");
// console.log("mongodb is ", mongodb);
mongodb.createCollection("test", (err, res) => {
if (err) {
throw ("Error creating a collection : ", err);
}
console.log("Collection creted");
});
But then react-native keeps giving this error :
TypeError: undefined is not a function(near 'MongoDB.createCollection...')