var ObjectId = mongoose.Types.ObjectId; // объявляем ObjectId
var sendPhotoRemovePush = function (user) {
return mongoose.model('Notice')
.findById(ObjectId("5b1055bab772d4a8c93dc0cf"), function (err, notice) {
var message = {
to: user.gcmId,
notification: {
title: user.locale == 'en' ? notice.titleEn : notice.titleRu,
body: user.locale == 'en' ? notice.bodyEn : notice.bodyRu,
sound: notice.sound
}
};
sendPush(message);
});
};