小程序 云开发 aggregate 多条件查询怎么写?
以管理身份查询时显示所有日期和加密内容,eq的条件无效?
let data = event.data,
date = data.date,
owner = data.owner,
skip = data.skip,
matched = true;
if (owner) {
matched = $.and($.eq(['$is_secret', 1]), $.eq(['$is_delete', 0]));
} else {
if (date) {
date = new Date(date + " 00:00:00");
let dateJson = $.dateFromString({
dateString: date.toJSON()
});
matched = $.and([$.gte(['$isodate_time', dateJson]), $.eq(['$is_secret', 0]), $.eq(['$is_delete', 0])]);
}
}