Closed nidem closed 6 years ago
Here is the example code from the README
Products.attachSchema(SimpleProductSchema, {selector: {type: 'simple'}}); Products.attachSchema(VariantProductSchema, {selector: {type: 'variant'}});
I have similar code where the schema is based on the based the type. This works:
Settings.update _id: doc._id, $set: value: not doc.value type: 'Boolean'
The above works when I specify the type to the selector is used. However, when do not specify a type in the update I get an error.
type
Exception while invoking method '/settings/update' TypeError: Cannot read property 'clean' of null
I've tried the following (I believe I'm following the instructions too):
Settings.update _id: doc._id, $set: value: not doc.value , selector: type: 'Boolean'
To tell collections2 to use the selector type of Boolean, but I get an error.
Ultimately, I'm trying to perform an update on a field that is dependent on the scheme selected.
Note: the above is in coffeescript
Closing old issues. Please comment if this is still an issue and should be reopened.
Here is the example code from the README
I have similar code where the schema is based on the based the type. This works:
The above works when I specify the type to the selector is used. However, when do not specify a
type
in the update I get an error.I've tried the following (I believe I'm following the instructions too):
To tell collections2 to use the selector type of Boolean, but I get an error.
Ultimately, I'm trying to perform an update on a field that is dependent on the scheme selected.
Note: the above is in coffeescript