问个查询云数据库的小白问题
发布于 5 年前 作者 tshen 16446 次浏览 来自 问答

每次返回的是所有这条记录的所有字段,如果只要一个字段s2的数据怎么弄?

// 查询当前用户所有的 counters

db.collection(‘area_2’).where({s1:1007}).get({

success: res => {

this.setData({

queryResult: JSON.stringify(res.data, null, 2)

})

console.log(’[数据库] [查询记录] 成功: ', res)

},

fail: err => {

wx.showToast({

icon: ‘none’,

title: ‘查询记录失败’

})

console.error(’[数据库] [查询记录] 失败:’, err)

}

})

回到顶部