These are chat archives for Automattic/mongoose

14th
Jul 2015
sivaram si
@sivaramsi
Jul 14 2015 07:32
is it possible to sort by subdocument value ?
var errorSchema = new db.Schema({
type: {
type: 'String'
},
action: {
type: 'String'
},
error_slug: {
type: 'String'
},
upvotes:{
type:'number',
default:0
}
});
var schema = new db.Schema({
solution: {
type: 'String',
required: true
},
url:{
type:'String'
},
errorlists: [errorSchema]
});
i wanna sort the results based on upvotes for an error