wixData.query .ascending not sorting reliable

The .ascending(“columnName”) sorts more or less in 50% of times the code is ran. What should I do?

$w.onReady(function () {
    dbToSearch = memory.getItem("dbToSearch");  //gets database name
    wixData.query(dbToSearch)
        .ascending("categoryNumber")
        .find()
        .then( (results) => {
            menuItems = results.items;
            console.log("menuItems: " + JSON.stringify(menuItems));
            $w("#menuRepeater").data = menuItems;
            $w("#menuRepeater").show();
    } );
});

You mean the sorting is wrong? Or the items does not shows all?

Sorting is wrong. What’s the logic behind the process of extracting the items? If it doesn’t sort with the .ascending code, does it sorts by creation date or another specific way?

I think I resolved the issue by removing the .ascending() code from the query and adding a sort rule directly in the dataset settings. Either way, I would recommend to Wix’s developers to take a look at this, since, it is not working properly, and definitely it could affect negatively other users.