只要未指定排序顺序,下面就会运行一些Node / Express代码。有人知道为什么它不会让我对查询进行排序吗?
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"));
}
...
显然有两个表:Businesses
和Navigation
。 Navigation
有一个名为SortOrder
的列,我试图按其排序。