Skip to content

v5.0.0

Latest

Choose a tag to compare

@harryadel harryadel released this 31 Aug 09:38
· 2 commits to master since this release
e6612ec

Collection2 5.0.0

Collection2 5 modernizes the supported validation stack and adds async validation and Zod autoValues.

What's new

  • Await SimpleSchema 3 cleaning, autoValues, field validators, and whole-document validators before database writes.
  • Apply Zod defaults through nested objects and arrays without persisting transforms, coercions, catches, or unknown-key stripping.
  • Add experimental Zod autoValue(schema, fn) support with sync or async operation context, modifier return values, and unset().
  • Support Zod autoValues in inserts, concrete $set and $setOnInsert values, direct and $each $push and $addToSet payloads, and positional array updates.
  • Preserve untouched element fields during dotted positional updates and harden modifier traversal against inherited properties, accessors, and shared-prototype writes.

Breaking changes

  • Meteor 3.1.2 or newer is required.
  • SimpleSchema 3 is required; applications using it must call insertAsync, updateAsync, or upsertAsync for mutations.
  • Zod 4 is required; Zod 3 schemas now fail with an explicit upgrade error.

SimpleSchema 3 async support was originally contributed by Matthew Turner (@thumptech) in #480.

See PR #504 for implementation and verification details.