js:
data:{
listDatas: null // presence of the requested data array inside the
}
onLoad: function (options) {
const db = wx.cloud.database();
db.collection ( 'otheritems'). get (). then (res => {// otheritems is set inside the name of the database
console.log (res); // update the data successfully if the outcome is successful information
var that = this;
that.setData({
listDatas: res.data
});
console.log(res.data);
}).catch(err => {
console.log (err); // if the update fails the data output failure information
})
},