From 7dbfd2f425975f025b09a710fae22d4dd6424764 Mon Sep 17 00:00:00 2001 From: Mike Fitzpatrick Date: Sun, 4 Mar 2018 22:05:19 -0500 Subject: [PATCH] no message --- models/profile.js | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/models/profile.js b/models/profile.js index e538920..c25dc7c 100644 --- a/models/profile.js +++ b/models/profile.js @@ -173,8 +173,9 @@ module.exports = { .select('messages') .populate({ path: 'messages', - match: { $and: [{ isUser: true }, { image: { $exists: true }, text: { $exists: false } }] }, - select: 'image -_id' + match: { $and: [{ isUser: true }, { image: { $exists: true } }, { text: { $exists: false } }] }, + select: 'image -_id', + sort: { order: 1 } }) .exec((err, result) => { if (err) {