Why there is no support for reference document inside an embedded document? it's just take the whole data instead of what i expected to save which is the embedded data along with the id for the reference document.
` // Replace EmbeddedDocument references with just their data
_.keys(that._schema).forEach(function(key) {
if (isEmbeddedDocument(that[key]) || // isEmbeddedDocument OR
(isArray(that[key]) && // isArray AND contains value AND value isEmbeddedDocument
that[key].length > 0 &&
isEmbeddedDocument(that[key][0]))) {
The line toUpdate[key].push(v._toData()); just take the whole data, can I replace this with the _id of the document and handle the read part or this is a bad approach?
Hi there,
Why there is no support for reference document inside an embedded document? it's just take the whole data instead of what i expected to save which is the embedded data along with the id for the reference document. ` // Replace EmbeddedDocument references with just their data _.keys(that._schema).forEach(function(key) { if (isEmbeddedDocument(that[key]) || // isEmbeddedDocument OR (isArray(that[key]) && // isArray AND contains value AND value isEmbeddedDocument that[key].length > 0 && isEmbeddedDocument(that[key][0]))) {
The line
toUpdate[key].push(v._toData());
just take the whole data, can I replace this with the _id of the document and handle the read part or this is a bad approach?Thanks!