Closed larspetrus closed 3 years ago
You realize you're in percolate migration's correct?
Anyway, you can do SomeCollection.direct to avoid collection2 cleaning your data.
My suggestion was that this framework would work around this problem, but I understand if that's not something you prioritize.
Mentioning it in the documentation could be a good idea.
I couldn't find any documentation for SomeCollection.direct, but if I'm doing a workaround, I'm happy with validate: false
.
Removing a column from SimpleSchema is problematic. The obvious code is
SomeCollection.update({}, {$unset: { someAttribute: 1 }}, {multi: true});
But SimpleSchema fails with
Error: someAttribute is not allowed by the schema
. This works...SomeCollection.update({}, {$unset: { someAttribute: 1 }}, {multi: true, validate: false});
...but it feels hacky and something no one will think of until they've been burned. Some ideas:
removeField(collection, field)
Collection.update()
and always addvalidate: false
.