This is the Schema:
var userschema = new mongoose.Schema({
user: String,
messages: [{
title: String,
author: String,
message: String,
date: { type: Date, default: Date.now },
}],
});
I'm trying to show all the users' message in a single page ordered by date. I know how for example show all the messages of a specific user, but if I have multiple users, I don't know how to classificate their message by date using mongoose. Is there any way to do this...?
Thank's advance!