Help with value._id

If I try to put values with spaces or accents into my database, the repeater doesn’t show the values. Anybody know how to solve it?

import wixData from 'wix-data';

$w.onReady (function () {
    gerarMenu($w('#repCat'), $w('#btnFiltroCat'), "Produtos", "categoria")
})

function gerarMenu($repetidor, $botao, banco, campo){
    wixData.aggregate(banco)
    .group(campo)
    .count()
    .run()
    .then((data) =>{
        let dadosParaLista = []
        console.log(data)
        data.items.forEach((value, id) =>{
            dadosParaLista.push({'_id':value._id, 'label': value._id + " (" + value.count + ")"})
        })

        console.log(dadosParaLista)

        $repetidor.data = dadosParaLista

        $repetidor.onItemReady (($item, itemData)=> {

            $item ('#' + $botao.id).label = itemData.label
        
            $item ('#' + $botao.id).onClick((event)=>{

                $w('#dynamicDataset').setFilter(wixData.filter().eq(campo, event.context.itemId))

            })
        })
    })

You have a few mistakes (I don’t know if they’re related to the problem you described.

  1. The $repetidor . onItemReady shouldn’t be inside the .then() part . Set it before the query.

  2. You shouldn’t put event handlers inside $repetidor . onItemReady . Instead go the NPMs, install the repeater-scope package, and go over the readme instructions to see how to use useScope in event handlers.