亚洲在线久爱草,狠狠天天香蕉网,天天搞日日干久草,伊人亚洲日本欧美

為了賬號安全,請及時綁定郵箱和手機立即綁定
已解決430363個問題,去搜搜看,總會有你想問的

為什么我的匯總返回重復數據?

為什么我的匯總返回重復數據?

一只斗牛犬 2021-04-20 09:14:30
我對mongo聚合還很陌生,所以我的鼻子出現在mongo文檔中試圖解決它。越來越近了!我正在對數據集運行一些查詢,以從保存數據文檔中獲取當前結果。但是我得到的響應是集合中第一個結果的重復。const result = await MemoryCard.aggregate([    {      $lookup: {        from: 'users',        localField: 'owner',        foreignField: '_id',        as: 'owner',      },    },    {'$unwind': '$owner'},    {$unwind: '$progress'},    {$match: {      'progress.createdAt': {        $gte: d,        $lte: new Date(),      },      'progress.file_one': {$eq: true},      'progress.file_two': {$eq: true},    }},    {$unwind: '$profiles'},    {      '$project': {        'owner.email': 1,        'owner.username': 1,        'progress': 1,        'profiles': 1,      },    },  ]);
查看完整描述

1 回答

  • 1 回答
  • 0 關注
  • 171 瀏覽
慕課專欄
更多

添加回答

舉報

0/150
提交
取消
微信客服

購課補貼
聯系客服咨詢優惠詳情

幫助反饋 APP下載

慕課網APP
您的移動學習伙伴

公眾號

掃描二維碼
關注慕課網微信公眾號