时间:2019-05-07 来源:小程序工厂
你好,问题没有复现,可以提供下会出问题的一条完整 JSON 记录,以及对应的查询语句吗?
数据库中的一条记录:
prototype:{ productGraphic':"cloud://ie-assistant-test-3cd336.fa71-ie-assistant-test-3cd336/productGraphic/oWZEW0ZRlK5mOvAJ8iNLLJi5cmBg/productGraphic-39-925.png"},projectBriefing:{projectGraphic:"cloud://ie-assistant-test-3cd336.fa71-ie-assistant-test-3cd336/projectGraphic/oWZEW0ZRlK5mOvAJ8iNLLJi5cmBg/projectGraphic-22-723.png",projectName:"1"},userResearch:{personas:"cloud://ie-assistant-test-3cd336.fa71-ie-assistant-test-3cd336/personas/oWZEW0ZRlK5mOvAJ8iNLLJi5cmBg/personas-6-927.png"},_id:"W587KLorBK9ufrIe"
.js文件中查询语句:
processDoc .where(_.or( { "userResearch.personas": (that.data.gallery == 'userResearch.personas') && _.neq(''),//that.data.gallery是传参 released: true }, { "projectBriefing.projectGraphic": (that.data.gallery == 'projectBriefing.projectGraphic') && _.neq(''), released: true }, { "prototype.productGraphic": (that.data.gallery == 'prototype.productGraphic') && _.neq(''), released: true })) .orderBy('createTime', 'desc') .skip(this.data.step += 20) .limit(20) .field({ '_id': true, 'userResearch.personas': true, 'projectBriefing.projectGraphic': true, 'prototype.productGraphic': true,
}) .get() .then(res => { this.setData({ 'galleryArray': this.data.galleryArray.concat(res.data), }).catch()
wxml中代码
count语句得到的记录数字正确,但是只有prototype字段中保存所有key键get得到值为undefined。其他字段中的值都能够正常get到。不明原因,求助,谢谢!