Skip to main content
Hi @Alberto_Nieto -
This behaviour is occurring because the filter is being applied before the array is unwound. Basically it’s filtering for documents where the array contains the expected values (in addition to other values) and then it’s unwinding all values to show on the chart.
To get the behaviour you want you need to move the array unwind before the filter. To do this you need to use the query bar, e.g. by specifying:
[{$unwind: "$data"}]
And then the filter will apply to the unwound values, filtering out anything you don’t want.
You are indeed unwinding the array, but when you do it this way it happens after the filter stage. You can’t change this so you need to move to unwind to the query bar to support your scenario.