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
Bot releases are hidden (Show)
Published by jankapunkt 6 months ago
Full Changelog: https://github.com/Meteor-Community-Packages/meteor-collection2/compare/4.0.0...4.0.1
Published by jankapunkt 7 months ago
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.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
Full Changelog: https://github.com/Meteor-Community-Packages/meteor-collection2/compare/3.5.0...4.0.0
Published by StorytellerCZ over 3 years ago
Published by StorytellerCZ over 3 years ago
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)Published by StorytellerCZ over 3 years ago
raix:[email protected]
and tmeasday:[email protected]
Published by StorytellerCZ over 3 years ago
tmeasday:check-npm-versions
to use version 1.0.1
as wellPublished by harryadel about 4 years ago
Published by StorytellerCZ over 4 years ago
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
Published by aldeed almost 9 years ago
denyInsert
and denyUpdate
to stop working. If using SimpleSchema v1.4.0 or higher, be sure to use Collection2 v2.7.1 or higher._id
is required in the schemaPublished 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.
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.