Update: User.history $last -> $arrayElemAt

This commit is contained in:
Yûki VACHOT 2021-12-13 20:03:22 +01:00
parent 3c0b26e166
commit b10ba5890f

View file

@ -452,7 +452,7 @@ exports.history = (req, res) => {
tags: true,
interest: true,
views: {$size: '$watchedDates'},
watchedDate: {$last: "$watchedDates"},
watchedDate: {$arrayElemAt: ["$watchedDates", -1]},
createdAt: true,
updatedAt: true
}}])