云开发减少搜索的时间

Collection.field

不必等所有的数据返回

只返回 pic 和 name 两个字段:

const db = wx.cloud.database()
db.collection('todos').field({
  pic: true,
  name: true
})
  .get()
  .then(console.log)
  .catch(console.error)

猜你喜欢

转载自blog.csdn.net/qq_41619567/article/details/84551675