I have a MongoDB with this structure:
Registration is an array & it's Object look like this:
{
"_id" : ObjectId("5e844235ead49b7ff33962d3"),
"date" : "2-jul",
"firstname" : "John",
"lastname" : "Doe",
"email" : "[email protected]",
"education" : "University",
"gender" : "male",
"age" : "32",
"workshop" : [2,3,6]
}
And known looks like this:
"known" : [
"[email protected]",
"[email protected]",
"[email protected]"
]
How can you check if registrations.email exists in known? If it exist how can you add a field to registrations: emailIsKnown: true or emailIsKnown: false?
I've tried different variations of filter, replaceRoot, lookUp with pipelines and mergeObject. But I can't seem to figure out how to only accomplish a minimum of comparing results or adding a field to the registrations object.
