Polmorphic lab assistance

The requirement were to include the following required fields: “first_name”, “last_name”,“recruiting_source” & “extend_offer”.

My confusion here lies in how to represent the polymorphic sub-documents of varying shape. My first attempt was to simply make the remaining differenced fields a stand alone object, similar to:
n.b. because education was similar across all three I made education an array across all three
{
“_id”: “”,
“first_name”: “”,
“last_name”: “”,
“recruiting_source”: “”,
“extend_offer”: “”,
“education”: [
{
“level”: “”,
“subject”: “”
}
],
“subdoc”: {
“engineer_level”: “”,
“years_experience”: “”,
“previous_employer”: “”,
“technical”: [""],
“non-technical”: {
“languages”: [""],
“other”: [""]
},
“candidate_notes”: “”
}
},…

but i fail validation…a little guidance would be helpful here. thanks in advance

There are couple of threads on this in our forum
Please check.It may help

Lab: Polymorphic Pattern

1 Like

Hi @Jeremiah_63395,

Let me know if you still need help. :slight_smile:

Kanika