We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
I ran this and when I checked the employees data using mongodb the team attribute was null;
To fix this I needed change 2 functions:
if (error) { console.error('Error: ' + error); } else { data.team_id = team1._id; }
changed to
if (error) { console.error('Error: ' + error); } else { team1.forEach(function (team1a) { data.teams.forEach(function (team) { if (team.name === team1a.name) { team.team_id = team1a._id; } }); }); }
Employee.update({}, { team: data.team_id }, {
Employee.update({}, { team: team.team_id }, {
The text was updated successfully, but these errors were encountered:
Thanks, Kelvin! How did the authors let this slip past?
Sorry, something went wrong.
No branches or pull requests
I ran this and when I checked the employees data using mongodb the team attribute was null;
To fix this I needed change 2 functions:
if (error) {
console.error('Error: ' + error);
} else {
data.team_id = team1._id;
}
changed to
Employee.update({}, {
team: data.team_id
}, {
changed to
The text was updated successfully, but these errors were encountered: