123456789101112131415161718192021222324252627282930313233343536373839 |
- // 云函数入口文件
- const cloud = require('wx-server-sdk')
- cloud.init({ env: cloud.DYNAMIC_CURRENT_ENV }) // 使用当前云环境
- const db = cloud.database()
- const mpdb1 = db.collection('mpdb1')
- const _ = db.command
- // 云函数入口函数
- exports.main = async (event, context) => {
- const wxContext = cloud.getWXContext()
- // return {
- // event,
- // openid: wxContext.OPENID,
- // appid: wxContext.APPID,
- // unionid: wxContext.UNIONID,
- // }
- // return console.log(111)
- // return mpdb1.get().then((res)=>{
- // console.log(res)
- // })
- // return await mpdb1.get()
- return await mpdb1.where({
- _id: _.in(["b751f28065b20b2708757dd94908a1d0","1601815765b20cc7000084e144cd60bf"])
- }).update({
- data:{
- msg: "hello word"
- }
- })
- // return await mpdb1.where({
- // _id: "b751f28065b20a7908756e32765ee932"
- // }).remove()
- }
|