小白想问问这个关于数据库的该怎么解决?

小程序 文章 2020-09-06 19:41 544 0 全屏看文

AI助手支持GPT4.0

小白想问问这个关于数据库的该怎么解决?Xiaobai would like to ask how to solve this about the database?

小白想问问这个关于数据库的该怎么解决?

调用云数据库报错

wx.cloud.database(...).collection(...).get(...).then(...).catech is not a function

但是下面打印又说获取数据成功

Call cloud database error wx.cloud.database (...). Collection (...). Get (...). Then (...). Catech is not a function

回答:

拾忆:

catch

A德佑-黄勇¹³³³³⁰⁶⁵³⁸¹:

文件头部先引入数据库啊,不然你怎么操作。

const db = wx.cloud.database()const todosCollection = db.collection('todos')


Mr.Chen:
collection('todos').doc('').get().then(res => {})或者collection('todos').where({_openid: 'xxx'}).get().then(res => {})

-EOF-

AI助手支持GPT4.0