WeChat applet-cloud development-database error:
-501007 invalid parameters | errMsg: Invalid Key Name: _openid
the reason:
_Openid cannot be set, it is automatically set by the cloud server according to the user's openID
solve:
Don't set openID
error code
wx.cloud.database().collection('people').add({
data: {
'_openid': openID,
'name': nickName,
'avatarUrl': avatarUrl,
'score': score
}
})
Correct code
wx.cloud.database().collection('people').add({
data: {
'name': nickName,
'avatarUrl': avatarUrl,
'score': score
}
})