Open aldeed opened 9 years ago
See also https://github.com/aldeed/meteor-simple-schema/issues/250
It still seems best and easiest to continue mutating in the simple-schema clean method, but do a deep clone (EJSON.clone() maybe) before that in the collection2 code.
Cleaning in the deny functions needs to mutate the object because that's the only way to alter the doc before it is inserted, but in the other two cases, we can clone to ensure no surprises for the user. Most likely a deep clone is necessary.
Add tests for this, and then fix such that they pass.