Below is some Node/Express code that runs fine as long as my sorting order isn't specified. Anybody know why it won't let me sort the query?
getBusiness("example.com");
function getBusiness(domain) {
var Businesses = Parse.Object.extend("Businesses");
var businessQuery = new Parse.Query(Businesses);
businessQuery.equalTo("AppUrl", domain);
businessQuery.first().then(
getNavigation,
handleError.bind(null, "error getting business"));
}
function getNavigation(business) {
var Navigation = Parse.Object.extend("Navigation");
var navigationsQuery = new Parse.Query(Navigation);
navigationsQuery.equalTo("Business",business);
navigationsQuery.ascending("SortOrder"); // When this isnt commented out, error
var promises = [];
navigationsQuery.each(function (navigation) {
promises.push(processNavigation(navigation));
}).then(
function () {
Parse.Promise.when(promises).then(
renderResult,
handleError.bind(null, "error processing navigations"));
},
handleError.bind(null, "error iterating navigations"));
}
...
There are obviously two tables: Businesses
and Navigation
. And Navigation
has a column called SortOrder
that I'm attempting to sort by.