请求关于云数据库表为空时 查询出错的问题?
我新建了一张表在云数据库,这时候还没有数据,然后,我在云函数进行id条件查询会报错。
正常不是null之类的吗?
难道每个查询之前都需要先查询表是否为空?
大概的报错如下:
Error: errCode: -1 unknown error | errMsg: document.get:fail document with _id 0709965b4f6c33f2c2cf859b12b231aa does not exist; at document.get api; at new CloudSDKError (C:\Users\hasbu\code\oil_preference\cloudfunctions\getGasCollect\node_modules\wx-server-sdk\index.js:6360:28) at returnAsCloudSDKError (C:\Users\hasbu\code\oil_preference\cloudfunctions\getGasCollect\node_modules\wx-server-sdk\index.js:6412:16) at Object.returnAsFinalCloudSDKError (C:\Users\hasbu\code\oil_preference\cloudfunctions\getGasCollect\node_modules\wx-server-sdk\index.js:6426:13) at DocumentReference.<anonymous> (C:\Users\hasbu\code\oil_preference\cloudfunctions\getGasCollect\node_modules\wx-server-sdk\index.js:1506:40) at step (C:\Users\hasbu\code\oil_preference\cloudfunctions\getGasCollect\node_modules\tslib\tslib.js:136:27) at Object.next (C:\Users\hasbu\code\oil_preference\cloudfunctions\getGasCollect\node_modules\tslib\tslib.js:117:57) at fulfilled (C:\Users\hasbu\code\oil_preference\cloudfunctions\getGasCollect\node_modules\tslib\tslib.js:107:62) at processTicksAndRejections (internal /process/task_queues .js:86:5) |