# Meteor-Community-Packages/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.

Repository: https://github.com/Meteor-Community-Packages/meteor-collection2
Canonical: https://ross.abutalabs.com/products/meteor-collection2
Homepage: https://packosphere.com/aldeed/collection2
Language: JavaScript
License: MIT
License Family: permissive
Topics: hacktoberfest, meteor, schema, mongodb, meteorjs, collection, database, mongo, validation
Last push: 2026-08-31T09:37:42+00:00

## Health v2 (maintenance only)
Score: 96/100 (v2, computed 2026-09-03T02:20:16.233290+00:00)
- activity 100, release rhythm 88, longevity 100
- inputs: {"age_days": 4790, "days_push": 2, "days_rel": 2, "gap_med": 34.0, "n_releases_24m": 11}
- flags: none
- formula: round(0.45*activity + 0.35*rhythm + 0.20*longevity); archived -> min(score, 10)

## Adoption (not part of the score)
Stars 1016, forks 112 (observed 2026-09-01T02:13:55.651178+00:00)

## What it is
A Meteor package that extends Mongo.Collection to attach schemas and automatically validate inserts and updates from client or server code. It supports validation via SimpleSchema, Zod, or AJV-style JSON schemas and includes data cleaning features like type conversion and auto-values.

## Use cases
- validate MongoDB documents against a schema in Meteor
- attach a schema to a Mongo.Collection
- automatically validate inserts and updates from client and server
- clean and convert data before saving to MongoDB
- define auto-values and custom validation for collection fields
- enforce unique and indexed fields in Meteor collections

## When to choose
- you are building a Meteor app with MongoDB and want schema enforcement at the collection layer
- you need automatic validation on both client and server writes
- you want data cleaning, type conversion, and auto-values applied before persistence

## When to avoid
- you use Meteor without MongoDB or a different database
- you prefer schema validation handled in application code or an ORM outside Meteor
- your project does not use the Meteor framework

## Facets
- artifact type: library
- maturity: active
- function: orm, database, form-handling, middleware
- domain: databases, web-development, backend, developer-tools
- platform: -
- tags: meteor, mongodb, schema-validation, data-cleaning, auto-values, client-server-validation, nodejs, javascript

## Member repositories
- Meteor-Community-Packages/meteor-collection2 (main) score 96

## Provenance
- Observed fields: from GitHub, fetched 2026-09-01T02:13:55.651178+00:00.
- Health v2: computed from the inputs above; adoption is never an input.
- Inferred fields (summary, facets, guidance): AI-extracted, prompt v1, taxonomy v1, on 2026-08-30T07:11:16.774466+00:00, confidence not recorded.
  - readme: https://github.com/Meteor-Community-Packages/meteor-collection2 (fetched 2026-09-01T02:13:55.651178+00:00, sha ea42dcf8a8ee)
  - homepage: https://packosphere.com/aldeed/collection2 (fetched 2026-08-29T13:10:30.968591+00:00, sha 44f278b807ac)
- Data as of 2026-08-30T08:39:29.467469+00:00.
