박권수

fix. mongodb query error

...@@ -86,7 +86,7 @@ const transPublishingTopicAndMessage = async(bottleId) => { ...@@ -86,7 +86,7 @@ const transPublishingTopicAndMessage = async(bottleId) => {
86 const bottleMedicine = await BottleMedicine.findOne({ bottleId, useYn : 'Y' }); 86 const bottleMedicine = await BottleMedicine.findOne({ bottleId, useYn : 'Y' });
87 const takeMedicineHist = await TakeMedicineHist.find({ 87 const takeMedicineHist = await TakeMedicineHist.find({
88 bmId : bottleMedicine._id 88 bmId : bottleMedicine._id
89 - }).sort((a, b) => a.takeDate < b.takeDate)[0]; 89 + }).sort({ takeDate : 'asc' })[0];
90 90
91 const message = 'res/' + await transDate(takeMedicineHist.takeDate) + '/' + bottleMedicine.dosage; 91 const message = 'res/' + await transDate(takeMedicineHist.takeDate) + '/' + bottleMedicine.dosage;
92 92
......