diff --git a/models/profile.js b/models/profile.js index 5c1a717..e538920 100644 --- a/models/profile.js +++ b/models/profile.js @@ -173,7 +173,7 @@ module.exports = { .select('messages') .populate({ path: 'messages', - match: { image: { $exists: true }, text: { $exists: false } }, + match: { $and: [{ isUser: true }, { image: { $exists: true }, text: { $exists: false } }] }, select: 'image -_id' }) .exec((err, result) => {