Seeking advice on how to retrieve all items in a collection while excluding one specific key:value pair?
The structure of my collection is as follows:
{ "_id" : "HsM4HpwrYAXh2PJeN",
"contact" : [ {
"emailAddress" : "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="365e5744444f764659424253441855595b">[email protected]</a>",
"someContact" : "No",
"creationDate" : "N/A",
"hardBounceBack" : "N/A",
"unsubscribed" : "No"
} ]
}
I have a total of 500 contacts in my “contacts” collection. My goal is to retrieve all contacts except for those with the value "unsubscribed":"No". I've experimented with $nin, $ne, and $where but haven't been able to find the correct approach to return everything excluding objects where "unsubscribed":"No".