-
Notifications
You must be signed in to change notification settings - Fork 116
Expand file tree
/
Copy pathcloud.test.ts
More file actions
33 lines (25 loc) · 836 Bytes
/
cloud.test.ts
File metadata and controls
33 lines (25 loc) · 836 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
const cloud = wx.cloud
const db = cloud.database()
const _ = db.command
// https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-sdk-api/constant/constant.html#%E7%A4%BA%E4%BE%8B
cloud.init({
env:cloud.DYNAMIC_CURRENT_ENV
})
cloud.callFunction({
name: 'getInfo',
config: {
env: cloud.DYNAMIC_CURRENT_ENV
},
})
// https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-sdk-api/Cloud.database.html
cloud.database({
throwOnNotFound:true
})
// https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-sdk-api/database/Database.runTransaction.html
db.runTransaction(async transaction => {transaction})
// https://developers.weixin.qq.com/miniprogram/dev/wxcloud/reference-sdk-api/database/aggregate/Aggregate.html
db.collection('')
.aggregate()
.match({})
.lookup({})
.end()