Closed burakkilic closed 8 years ago
Hi;
I have the following code:
doc.getArrayTree({ sort: { order: 1 } }, function(err, tree) { if (err) res.json(err); return res.json({ type: true, data: tree }); });
Order is not changes if I retrieve data like that. Where am I wrong?
Update:
I commented out
// sort by depth desc /map.sort(function (a, b) { return b.depth - a.depth; });/
in schema.static('ToArrayTree', function (docs, fields)
and now it is working.
Hi;
I have the following code:
Order is not changes if I retrieve data like that. Where am I wrong?