Projection function never retains anything from passed doc.

Always does deep copy.
This commit is contained in:
Slava Kim
2013-11-11 11:43:41 -08:00
committed by David Glasser
parent 74c9373d3a
commit b1f8930630

View File

@@ -25,7 +25,7 @@ LocalCollection._compileProjection = function (fields) {
res[key] = transform(doc[key], rule);
// Otherwise we don't even touch this subfield
} else if (details.including)
res[key] = doc[key];
res[key] = EJSON.clone(doc[key]);
else
delete res[key];
});