diff --git a/models/profile.js b/models/profile.js index ab7e932..c194ab7 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: { $elemMatch: { image: { $exists: true, $ne: null } } } }) + .find({ _id: profileId, messages: { $elemMatch: { image: { $ne: null } } } }) .select('messages.image') .exec((err, result) => { if (err) {