Ascending

I can not order in ascending order. Someone help me?
It has time that works and another that does not work.
Here is my code:
let rowsTbPermissao = [];
let rowsTbMembroPermissao = [];
let idMembro = $w(“#textid”).text;
let value = $w(“#dropdown1”).value;
let rowsMembros = [];
$w(“#tbMembro”).rows = [];
let id = [];
wixData.query(“MembroPermissao”)
.ascending(“permissaoNome”)
.eq(“permissaoNome”, value)
.find()
.then((results) => {
if (results.length > 0) {
for (let i = 0; i < results.totalCount; i++) {
let item = results.items[i];
id = item.idMembro;

                wixData.query("Membros") 
                    .ascending('nome') 
                    .hasAll("_id", [id]) 
                    .find() 
                    .then((res) => { 

                        for (let ii = 0; ii < res.totalCount; ii++) { 
                            item = res.items[ii]; 
                            rowsMembros.push({ "id": item._id, "nome": item.nome }); 

                        } 
                        $w("#tbMembro").rows = rowsMembros; 
                        preencherPermissao(idMembro); 

                    }) 
                    .catch((error) => { 
                        let errorMsg = error.message; 
                        let code = error.code; 
                    }); 
            } 
        } 
        else { 
            $w("#ir").disable(); 
            $w("#voltar").disable(); 
            $w("#tbMembro").rows = rowsMembros; 
            $w("#tbMembroPermissao").rows = rowsTbMembroPermissao; 
            $w("#tbPermissoes").rows = rowsTbPermissao; 
        } 

    })

Hey,
Do you get results but in the wrong order? Have you tried to change the queries so that first you use the " eq " function and than " ascending "?

Tal.

This change did not work.

Do you get results in the wrong order or you don’t get results at all?
If you get results in a wrong order, please send me the site URL so that I can have a look and specify to which page the code was added.

Thanks,
Tal.