Parse.com:添加排序导致查询错误

时间:2014-08-20 22:03:14

标签: node.js express parse-platform

只要未指定排序顺序,下面就会运行一些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"));
}

...

显然有两个表:BusinessesNavigationNavigation有一个名为SortOrder的列,我试图按其排序。

0 个答案:

没有答案