小程序云开发 Collection 如何获取指定的 field ,有 where

发布于 6 年前作者 xia792143 次浏览最后编辑 6 年前来自 ask
  • 当前 Bug 的表现(可附上截图)

Collection.field 使用问题,如下代码,我期望结果只返回 description、done、progress 这 3 个 field, 不加 where 条件时结果符合预期,但如果加了 where 条件,便返回了全部的 field,我该怎么做?这是我使用不当,还是 BUG?




const db = wx.cloud.database()



db.collection(‘todos’).field({


  description: true,


  done: true,


  progress: true


})


  .get()


  .then(console.log)


  .catch(console.error);

6 回复
min00
min001 楼6 年前
collection('xxx')
.orderBy('xxx','desc')
.field({
    xx1:true,
    xx2:true
}).get().then().catch()

试一下这样行不行

chengchao
chengchao2 楼6 年前

同问。

mma
mma3 楼6 年前

同问

xuwei
xuwei4 楼6 年前

发现类似问题,field指定其他字段为false,仍然还是会同时返回

cluo
cluo5 楼6 年前

同问

wei94
wei946 楼4 年前

同问