diff --git a/models/profile.js b/models/profile.js index 01a67ce..5af1436 100644 --- a/models/profile.js +++ b/models/profile.js @@ -169,7 +169,7 @@ module.exports = { allMessageImages: (e, profileId) => { const promise = new Promise((resolve, reject) => { ProfileModel - .find({ _id: profileId, 'messages.image': { $exists: true } }) + .find({ _id: profileId, 'messages.$.image': { $exists: true } }) .select('image') .exec((err, result) => { if (err) {