I have a method as shown below on server.js file in meteor
getNames : function(){
var name = AccNames.find({}, {fields: {'Name': 1, '_id': 1}}).fetch();
return name;
}
How Can I sort the result in ascending order? I mean how can I get the list of NAME in ascending order? Is it possible to use fetch and sort together?
AccNames.find({}, {fields: {'Name': 1, '_id': 1},{sort: {'Name': 1}}).fetch();didn't work?