lai:simple-schema-omit

v1.0.0Published 9 years ago

This package has not had recent updates. Please investigate it's current state before committing to using it in your project.

SimpleSchema.prototype.omit

What is this?

Allows you take a SimpleSchema object and get a new one with omitted fields.

Why did I make this?

Because this PR hasn't been merged yet.

What can you do with this?

1MySchema = new SimpleSchema({
2  field1: {
3    type: String
4  },
5  field2: {
6    type: String
7  },
8  field3: {
9    type: String
10  }
11});
12
13NewPrunedSchema = MySchema.omit(['field1']);
14// `NewPrunedSchema` only has the definition for `field2` and `field3` now

The prototype method was modeled after its counter part, pick.