匹配聚合中的mongodb对象ID

时间:2020-05-05 09:18:58

标签: mongodb aggregation-framework

我将当前用户的ID存储在user变量中。如何使用match聚合获取当前用户的值

const user = req.user.id;
    const aggregation = await Notification.aggregate([
        { $match: { userid: user } },
    ])

0 个答案:

没有答案