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.
New & Unread Topics
Topic | Replies | Views | Activity |
---|---|---|---|
What all goes behind the scene, when a mongoDB chart / dashboard is run? | 0 | 266 | Jul 2024 |
How can we access the data.metadata.age to determine when was the data last refreshed, from our embedding charts UI code | 0 | 143 | Aug 2024 |
String_to_Date format | 6 | 103 | Nov 2024 |
search bar in filter in dashboard | 0 | 14 | Jan 17 |
Can Charts create an Excel document? | 0 | 4 | 7d |