Agregation not working

hallo,

why my code not work ?

Hey @Stev_80585

Please review the docs for $count

2 Likes

Hi @Stev_80585,

Looks like that you want to find the count of all the documents where sections array field has size equal to 1.

For achieving this you can first find all the documents where size of sections array is 1 and then count them as shown in the below screenshot:

I hope it helps!!
Please let me know if you have any questions.

Thanks,
Sonali

1 Like