I'm a bit stuck at this point... I need to add a new property to a document that varies according to the values of that same document and the values of another document. I set an example to make it better understood.
I have a Candidate Schema:
const CandidateSchema: Schema<ICandidate> = new Schema({
role: {type: String},
yearsOfExperience: {type: Number},
compatibility: {type: Number} // Dynamic prop
});
And a Job Schema
const JobSchema: Schema<IJob> = new Schema({
title: {type: String},
postDate: {type: String},
requirements: {
role: {type: String},
yearsOfExperience: {type: Number}
}
});
Now I need to add to the candidate's "compatibility" property a new value based on the values of the candidate and a reference Job. This new property will be the compatibility between the Candidate and the requirements of the Job. In some cases I will need to find Candidates based on the compatibility property.
Thank you in advance.