I have the follwing schema:
var VisionsystemSchema = new mongoose.Schema({
linenumber: {
type: String,
index: true,
unique: true
},
name: String,
rois: [
{
name: String,
history: [Date, Number]
}
]
});
for each element in rois array i have an array of history values with a [date,number] tuple. how can i order the history array by its Date first element?