// 云函数入口文件
const cloud = require('wx-server-sdk'
cloud.init(
{
//开启环境
traceUser: true
}
const db = cloud.database()
// 云函数入口函数
exports.main = async (event, context) => {
dataJson = {
"modelid": 11,
"name": 11,
"phone": 332,
"postid": 11,
"registerTime": 11,
"remarks": 11,
"right": 55,
"sex": 1,
"unitid": "shsshe什么"
}
db.collection('register').add({
// data 字段表示需新增的 JSON 数据
data: dataJson
})
.then(res => {
//console.log(res)
//return res._id
})
await.
请大神释疑!