- 当前 Bug 的表现(可附上截图)
- 预期表现
- 复现路径
- 提供一个最简复现 Demo
当我where为空时,即我想删掉集合所有元素时,where是不是应该为{}, 下面2种写法都报错,是bug吗还是不应该这么写,那怎么写才能删除集合所有数据呢
写法1:
return await db.collection(collection).remove()
写法2:
return await db.collection(collection).where({})
.remove()
}
{ Error: errCode: -501007 invalid parameters | errMsg: Param query can't be empty;
at new CloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6360:28)
at Object.returnAsCloudSDKError (/var/user/node_modules/wx-server-sdk/index.js:6412:16)
at Object.checkError (/var/user/node_modules/wx-server-sdk/index.js:1673:23)
at CollectionReference.<anonymous> (/var/user/node_modules/wx-server-sdk/index.js:1804:41)