一段时间以来,我一直试图将表单中的数据保存在MongoDB中。
我还从数据库中得到了一个响应。
不幸的是,没有足够的教程,我的母语,我似乎不理解所有的英语。
我试过一些文档,但总是失败。我的web钩子函数中缺少什么,以便可以存储表单数据?
exports = function(payload) {
const mongodb = context.services.get("mongodb-atlas");
const mycollection = mongodb.db("created_notifications").collection("dpvn_collection");
return mycollection.find({}).limit(10).toArray();
};发布于 2021-05-12 07:15:41
网络功能是完全错误的。
阅读 文档 FIRST
exports = function(payload, response) {
const mongodb = context.services.get("mongodb-atlas");
const requestLogs = mongodb.db("created_notifications").collection("dpvn_collection");
requestLogs.insertOne({
body: EJSON.parse(payload.body.text()),
query: payload.query
}).then(result => {
})
};https://stackoverflow.com/questions/67490163
复制相似问题