I am trying to do sort id
Modal:
module.exports = {
autoPK: false,
attributes: {
id: {
type: 'integer',
autoIncrement:true,
primaryKey: true
},
}
}
Query:
mymodal.find().sort({id: 'asc'}).exec(function (err, res) {
console.log(res)
});
Data:
[ { id: '2', },{ id: '1'},{ id: '11' } ]
Actual:
[ { id: '1', },{ id: '11'},{ id: '2' } ]
**Expected:
[ { id: '1', },{ id: '2'},{ id: '11' } ]**
Can anybody help me out. Please..
Sorting on string working, but on number(interger).
Is there any with my query or issue with sails waterline criteria sort