Est-ce qu’il me manque quelque chose?
Vous avez 2 enregistrements pour ‘candidat1’. Premier enregistrement = 10, deuxième enregistrement est 20.
10 + 20 = 30 ???
Je vois que vous récupérez 2 enregistrements du résultat de la somme. Hmm, ne devriez-vous pas seulement en récupérer un pour ‘candidat1’
Pourquoi avez-vous utilisé .contains(), plutôt que .eq()?
(J’ai utilisé google translate).
English:
What am I missing?
You have 2 registrations for ‘candidate1’.
First record = 10, second record = 20.
10 + 20 = 30 ???
I see that you are getting 2 records from the aggregate result of sum().
Hmm, shouldn’t you just get one for ‘candidat1’.
Why did you use the .contains(), rather than .eq() when defining your filter?
When you use .contains, the search/matching is case insensitive and doesn’t have to be exact. If ‘iMail’ = ‘candidat’, then it will match all your records. Use console_log, to see what the filter is being set to.
Because you are setting up your filter to sum for 1 candidate only and you want the total of all vues, your wixData.aggregate function does not need the .group(‘candidat’) line.