Quantcast
Channel: Active questions tagged mongodb-atlas - Stack Overflow
Viewing all articles
Browse latest Browse all 271

How do I display an element match field in the chart

$
0
0

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.


Viewing all articles
Browse latest Browse all 271

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>