Skip to content

Commit

Permalink
fix: mongoose response document will fill undefined in not exist field
Browse files Browse the repository at this point in the history
The model will fill undefined in not exist field.
Use _doc to get original object
  • Loading branch information
Chinlinlee committed Oct 28, 2021
1 parent e3096e2 commit fa5a73d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion FHIR-mongoose-Models-Generator/resourceGenerator.js
Original file line number Diff line number Diff line change
Expand Up @@ -243,7 +243,7 @@ function generateResourceSchema (type) {
});\r\n
${type}Schema.methods.getFHIRField = function () {
let result = this.toObject();
let result = this._doc();
delete result._id;
delete result.__v;
if (_.get(result, "myCollection")) {
Expand Down

0 comments on commit fa5a73d

Please sign in to comment.