Hello Guys, i am having issue with getting data that $match value in an array and get those data by array or Object
This is the document that i want to fetch data from
{
"_id": {
"$oid": "62908343716f52001696cc9b"
},
"wards": [
{
"admissionNumber": "Sil 0020",
"schoolCode": "SC227043"
},
{
"admissionNumber": "Sil 0023",
"schoolCode": "SC227043"
}
],
"verify": false,
"regPoint": 4,
"completeRegistration": true,
"email": "",
"schoolId": {
"$oid": "624f9790a900d000165b543e"
},
"password": "$2a$10$60aNQeReDfHohft1P5WDjuWwfvCtJZlr.7sjUbDU8K8TpQgs5U1oG",
"__v": 0,
"otp": "3654",
"phoneNumber": "8028944791",
"address": "22 apata alakia ibadan",
"firstName": "taiwo",
"lastName": "omotola",
"about": "life",
"imgUri": ""
}
{
"_id": {
"$oid": "6290958b767b9000169383e9"
},
"wards": [
{
"admissionNumber": "HOG001",
"schoolCode": "H223302"
},
{
"admissionNumber": "HOG0010",
"schoolCode": "H223302"
}
],
"verify": false,
"regPoint": 4,
"completeRegistration": true,
"email": "olayemi@mail.com",
"schoolId": {
"$oid": "621f990511e2b40016a22fad"
},
"password": "$2a$10$xWbINEzm/NvyQw0CWKKsMukxnvh2UC1MjKKoOjb5QtuATuYeI8f52",
"__v": 0,
"otp": "7509",
"phoneNumber": "8067410631",
"address": "60 association road",
"firstName": "olayemi",
"lastName": "williams"
}
and so on.
i want to get all the data of any student that his/her admissionNumber $match
Dia001
Dia002
DI001
BHS00200
BHS00100
BHS00300
dia007
FTS00400
HOG001
HOG002
HOG003
HOG004
Please i need to explain further, kindly help me