云数据库.field出现BUG
发布于 4 年前 作者 xia76 5093 次浏览 来自 问答

云数据库查询时,where和field同时使用,field无效,下面的代码中field字段必须同时为true,如果有一个不一致就没有查询结果,如何解决,请指导。

const re = await db.collection(‘XXXX’).where({

opid: event.userInfo.openId,

}).field({

_id: true,

opid: false,

wxnm: true,

yhnm: true,

yhlx: true,

fxid: true,

fxcs: true,

fxjf: true,

dlcs: true,

dldt: true,

}).get();

}

})

3 回复

我遇到的问题是,where要放在field前面就可以了

你好,这个问题我也不理解,我返回来的数据也是所有字段的数据,请问你是怎么解决的?是不是只是提交的时候只提交字段里有的数据啊?

解决了,是我理解错了

回到顶部