PS
Size: a a a
PS
IK
YG
PS
YG
YG
IK
IK
AC
const data = await User.aggregate([
{ $match : { _id : user._id } },
{ $lookup: { from: "standupanswers", localField: "_id", foreignField: "user", as: "standupanswers" }},
{ $lookup: { from: "updateanswers", localField: "_id", foreignField: "user", as: "updateanswers" }},
{ $lookup: { from: "recognitions", localField: "_id", foreignField: "recipient", as: "recognitions" }},
{ $project: { body: { $concatArrays: ["$standupanswers", "$updateanswers", "$recognitions"] } } },
{ $sort : {"$body.date" : 1 } }
]);
VL
I
NE
NE
AC
AC
AC
let sortArr = data[0].body.sort(function compare(a, b) {
var dateA = new Date(a.date);
var dateB = new Date(b.date);
return dateA - dateB;
});
B
B
R