如何利用云函数突破数据库20条数据上限写map组件markers?

小程序 文章 2022-03-10 09:20 0 全屏看文

如何利用云函数突破数据库20条数据上限写map组件markers?How to use cloud functions to break through the upper limit of 20 data in the database to write map component markers?

如何利用云函数突破数据库20条数据上限写map组件markers?

我之前是直接用.get()获取数据库数据,但是只能获取20条,后面我就想利用云函数做到突破数据获取上限,现在数据是突破了,但是我的marker在地图上却显示不出来。

接着就报错: Setting data field "markers" to undefined is invalid

像这种情况是要怎么解决呢?


I used to use it directly Get() gets the database data, but only 20 items can be obtained. Later, I want to use the cloud function to break through the upper limit of data acquisition. Now the data has broken through, but my marker can't be displayed on the map. Then an error will be reported: setting data field "markers" to undefined is invalid. How to solve this situation?

回答:

八九:

res.result

再见,电脑崽:
that.setData({  markers: res.result //注意数据结构})
dreamhunter:

markers: res.result

-EOF-