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.

MIT License

Stars
1K
Committers
36

Bot releases are visible (Hide)

meteor-collection2 - 4.0.2-beta.1 Latest Release

Published by jankapunkt 6 months ago

meteor-collection2 - 4.0.1

Published by jankapunkt 6 months ago

meteor-collection2 - 4.0.0

Published by jankapunkt 7 months ago

What's Changed

Breaking

  • You no longer need to install simpl-schema as we from now on use the Meteor package aldeed:simple-schema again, which is now under our maintenance. While the npm package works, there will be no Meteor support in the future and we decided for a hard fork in order to remain compatible.
  • Collection2 is now optionally dynamic OR static imported. This allows to reduce client bundle size.

In order to import it dynamically you need to run:

import 'meteor/aldeed:collection2/dynamic'

Collection2.load() // returns a promise!!!!

In order to import it statically you need to run:

import 'meteor/aldeed:collection2/static'
Collection2.load() // no promise

New Contributors

Full Changelog: https://github.com/Meteor-Community-Packages/meteor-collection2/compare/3.5.0...4.0.0

meteor-collection2 -

Published by harryadel about 3 years ago

Add the ability to override in-built schema clean options.

meteor-collection2 - v3.4.1

Published by StorytellerCZ over 3 years ago

  • Make compatible with Meteor 2.3
meteor-collection2 - 3.4.0

Published by StorytellerCZ over 3 years ago

  • Code modernization in few places
  • You can now set packages.collection2.disableCollectionNamesInValidation in your Meteor settings to disable showing Collection name in errors from server, this is set to false by default to preserve the original behavior. (fixes #422)
  • Moved from CircleCI testing to GitHub actions
meteor-collection2 - 3.3.0

Published by StorytellerCZ over 3 years ago

meteor-collection2 - 3.2.2

Published by StorytellerCZ over 3 years ago

  • Allow tmeasday:check-npm-versions to use version 1.0.1 as well
meteor-collection2 - 3.2.0

Published by harryadel about 4 years ago

meteor-collection2 - 3.1.0

Published by StorytellerCZ over 4 years ago

  • Added pick and omit feature
  • Updated dependencies
  • Updated tests
  • Added GitHub templates for issues and PRs.
meteor-collection2 - 2.8.0

Published by aldeed almost 9 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

meteor-collection2 - 2.7.1

Published by aldeed almost 9 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
meteor-collection2 - v2.6.0

Published by aldeed almost 9 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.

meteor-collection2 -

Published by aldeed about 9 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
meteor-collection2 -

Published by aldeed about 9 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
meteor-collection2 -

Published by aldeed over 9 years ago

Use latest simple-schema version

meteor-collection2 -

Published by aldeed over 9 years ago

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

Published by aldeed almost 10 years ago

Fix handling of _id property on client to match server.

meteor-collection2 -

Published by aldeed almost 10 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.