I have a collection which has the sample data below:
[ { 'StudentId': 1'StudentLoans': [ {'LoanName': 'A','StartDT' : '2024-09-01T00:00:00Z','EndDT' : '2024-09-01T00:00:00Z' }, {'LoanName': 'B','StartDT' : '2024-09-01T00:00:00Z','EndDT' : null } ] }, { 'StudentId': 2'StudentLoans': [ {'LoanName': 'B','StartDT' : '2024-09-01T00:00:00Z','EndDT' : '2024-09-01T00:00:00Z' }, {'LoanName': 'C','StartDT' : '2024-09-01T00:00:00Z','EndDT' : null } ] }]
my query is :
{'StudentLoans': {$elemMatch: {'EndDT': null}}}
When I apply the query in charts.mongodb and set the id to X Axis and LoanName to Y Axis, it displays loans A, B and C.
It should only display B and C since EndDT = null
I am expecting that only Loans B and C should be displayed but in the charts it is including A.