Meteor Collection2 Versions Save

A Meteor package that extends Mongo.Collection to provide support for specifying a schema and then validating against that schema when inserting and updating.

2.8.0

8 years ago

No changes, but aldeed:collection2 is now a shell package that installs three component packages: aldeed:collection2-core, aldeed:schema-index, and aldeed:schema-deny

2.7.1

8 years ago
  • Fixed an issue where an accidental breaking change in SimpleSchema v1.4.0 caused denyInsert and denyUpdate to stop working. If using SimpleSchema v1.4.0 or higher, be sure to use Collection2 v2.7.1 or higher.
  • Fix upsert validation when _id is required in the schema
  • Throw a clearer error for when all keys are removed from the document or modifier during filter cleaning

v2.6.0

8 years ago

Even if you skip all validation and cleaning, Collection2 will still do some object parsing that can take a long time for a large document. To bypass this, you can now set the bypassCollection2 option to true when you call insert or update. This works only in server code.

v2.5.0

8 years ago
  • docId is now set in the autoValue and custom contexts for inserts, too, if possible
  • The validationContext option can now be a reference to a context instead of a string name

v2.4.0

8 years ago
  • Validation and cleaning is no longer duplicated when using the upsert method instead of {upsert: true} option.
  • Added sparse option which can be set to true along with index option to force a sparse index

v2.3.3

9 years ago

Use latest simple-schema version

v2.3.2

9 years ago
  • Properly set docId in autoValue and custom contexts when provided as non-object. (Thanks @FatBoyXPC)
  • Update SimpleSchema package dependency version

v2.3.1

9 years ago

Fix handling of _id property on client to match server.

v2.3.0

9 years ago

You can now pass an extendedCustomContext option when calling insert or update. Set this to an object that will be used to extend this within any custom validation functions that are called.

You can now pass an extendAutoValueContext option when calling insert or update. Set this to an object that will be used to extend this within any autoValue functions that are called.

Note that the extendedCustomContext and extendAutoValueContext options will work fine for calls in server code or calls against local (unmanaged) collections in client code, but they will not work with calls against normal (managed) collections in client code. When the second round of validation happens on the server, your custom contexts will not be set.

Also: When a validation error is passed to the insert or update callback, error.validationContext is now set to the validation context that was used.