Meteor-Community-Packages / meteor-collection2

A Meteor package that extends Mongo.Collection to provide support for specifying a schema and then validating against that schema when inserting and updating.
https://packosphere.com/aldeed/collection2
MIT License
1.02k stars 108 forks source link

Add support for 'pick' and 'omit' options in insert or update operations #389

Closed ghost closed 4 years ago

ghost commented 5 years ago

Allow mutually exclusive pick/omit options for insert and update operations. This provides simple inline syntax and avoids needing to create a whole named context or separate schema just to limit the fields allowed in a given operation. Similarly to the 'keys' option, the value would be an array of field names that will be spread into the pick or omit function call when it is run. An error is thrown if both pick and omit are provided because there is no good way to determine which should go first.

ghost commented 5 years ago

@aldeed Any possibility of this getting accepted or does it somehow not work with the design you're going for?

StorytellerCZ commented 4 years ago

@jeffm24 This looks pretty good! I'll see if I can take it for a spin soon to test it out.