From d60b2f831d6767b7c70a0d8c5b6a7bdbc3e331a6 Mon Sep 17 00:00:00 2001 From: Mike Fitzpatrick Date: Sun, 4 Mar 2018 22:01:32 -0500 Subject: [PATCH] no message --- models/profile.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/models/profile.js b/models/profile.js index ce92223..5c1a717 100644 --- a/models/profile.js +++ b/models/profile.js @@ -172,9 +172,9 @@ module.exports = { .find({ _id: profileId }) .select('messages') .populate({ - match: { image: { $ne: null } }, path: 'messages', - select: 'image' + match: { image: { $exists: true }, text: { $exists: false } }, + select: 'image -_id' }) .exec((err, result) => { if (err) {