From 293adbbaa0640f2e29189a2f43e48ae09b94a0ad Mon Sep 17 00:00:00 2001 From: Mike Fitzpatrick Date: Sun, 4 Mar 2018 22:31:55 -0500 Subject: [PATCH] no message --- models/profile.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/models/profile.js b/models/profile.js index d4eb621..43cb866 100644 --- a/models/profile.js +++ b/models/profile.js @@ -172,7 +172,7 @@ module.exports = { .aggregate( { $match: { _id: profileId } }, { $unwind: '$messages' }, - { $match: { 'messages.image': { $exists: true } } } + { $match: { $and: [{ 'messages.isUser': false }, { 'messages.image': { $exists: true } }] } ) .exec((err, result) => { if (err) {