【发布时间】:2020-02-11 04:33:03
【问题描述】:
有没有办法在 react-native 的 MongoDB 缝合应用程序中创建一个集合。我尝试了正常的MongoDB方式
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");
});
但随后 react-native 不断给出此错误:
TypeError: undefined is not a function('MongoDB.createCollection...'附近)
【问题讨论】:
标签: mongodb react-native mongodb-stitch stitch