Here is my schema,
{
"_id": {
"$oid": "62dfef1a6fa3ca52622b02e4"
},
"dealer_id": 1499,
"credentials": {
"62e12c210b2d6": {
"account_id": "942646",
"terminal_id": "310012",
"provider": "Epay",
"supplier": "verizon",
"username": "hello",
"password": "world",
"portal_link": "https://localhost",
"certificate_key": "olsjhflsaknfdlaksfd",
"certificate_file": "aa.txt"
}
},
"updated_at": {
"$date": {
"$numberLong": "1659553693372"
}
},
"created_at": {
"$date": {
"$numberLong": "1658842906093"
}
}
}
Each credentials will have dynamic uniqid, how can i query by username? there will be multiple credentials for each document and how can i search by any field i also need to retrive only dealer_id which is in parent.
Thank you