Prepared date: 2026-06-16 Release status: Never published; superseded by v3.0.0 Type: Withdrawn patch candidate Compatibility: Contains compatibility-impacting behavior changes; see below
This candidate must not be tagged or published. Its accumulated public additions and compatibility-impacting changes require a major release, so the canonical release inventory and upgrade guidance moved to v3.0.0. The detail below is retained only as historical review evidence.
The withdrawn v2.0.7 candidate collected release-readiness work after v2.0.6: model optimistic concurrency, transaction cache invalidation, Change Stream sync ordering, soft-delete read visibility, MongoDB driver option forwarding, batch-write retry behavior, distributed invalidation, and bounded production data tasks.
- Versioned Model single-document writes now enforce true optimistic concurrency control: stale writes throw
WRITE_CONFLICT, and writes withoutexpectedVersion,version, or a direct_idautomatic lookup path may throwINVALID_ARGUMENT. - Versioned
updateMany()defaults tocounter, which increments version counters without optimistic locking. UseversionMode: 'strict'for per-document conditional updates orversionMode: 'off'for compatibility behavior. find()now defaults tofindLimit: 500; explicit positivelimitandskipvalues are bounded byfindMaxLimitandfindMaxSkip.limit(0)intentionally keeps MongoDB's unlimited cursor semantics.- Change Stream resume token persistence is strict by default: token save/load failures stop synchronization unless
strictSave: false/strictLoad: falseis configured for legacy best-effort behavior. updateBatch({ upsert: true })is rejected becauseupdateBatchwalks existing matching_idvalues and cannot express MongoDB's single-documentupdateMany(..., { upsert: true })insert semantics. UseupsertOne()or nativeupdateMany(..., { upsert: true })instead.dropDatabase()treatsNODE_ENV=production,prod, andliveas production-like environments that requireallowProduction: true.- Soft-delete filtering now covers the standard Model read surface including
findPage, ID reads,distinct,aggregate,stream, andexplain. - Populate
skip/limitfor has-many relations is applied per parent document, and nested populate is capped bymaxDepth(default5). ConnectionPoolManager.addPool()now applies the same strict pool config validation as the public validator before opening a client.- Change Stream
collections: ['*']now means all collections rather than a literal collection named*.
- Package metadata now describes monSQLize as a database-native TypeScript data runtime and no longer promotes business locks or Saga orchestration as primary package capabilities.
- Business lock and Saga documentation remains available for existing callers, but hidden compatibility pages now state the current runtime boundaries and recommend application/framework-level orchestration for new payment/order flows.
npm run test:unitnow delegates totest/run-tests.cjs unit, matching the maintained unit suite instead of a stale hand-written file list.- Validation ledgers now reflect the current 56 runnable TypeScript documentation examples.
initializeModelV1Methods()now reports factory failures through the runtime logger when available instead of writing directly toconsole.warn.- Versioned models now enforce true optimistic concurrency control for single-document writes: direct
_idfilters automatically read the current version, callers may override withexpectedVersion/version, and stale writes throwWRITE_CONFLICT. - Versioned
updateMany()now supports explicit modes:counterfor native batch version counters,strictfor per-document conditional updates, andofffor compatibility escape hatches. - Transaction cache invalidations are recorded during the transaction and replayed only after a successful commit; commit retry now handles
UnknownTransactionCommitResult. - Change Stream sync events are processed serially so target writes and resume token persistence stay ordered; resume token files use atomic replacement, strict load validation, and backup files in file mode; unexpected stream close events now mark sync as stopped in stats.
- Soft-delete filters now cover the standard model read surface, including
findPage, ID reads,distinct,aggregate,stream, andexplain. - MongoDB read paths now forward driver options such as
session,readConcern,readPreference,collation,hint,maxTimeMS, and aggregation options instead of dropping them through a narrow whitelist. - Query caches now avoid session-scoped reads and build stable cache keys only from result-shaping options.
- Distributed cache invalidation now uses separate Redis publish/subscribe connections when a Redis instance is provided and reports subscription failures.
- Batch insert retry now retries only the failed unordered subset after partial success instead of replaying the full chunk.
find()now defaults tofindLimit: 500, validates explicitlimit/skipvalues against configurablefindMaxLimitandfindMaxSkipcaps, and documents thatlimit(0)intentionally keeps MongoDB's unlimited semantics.findPage().offsetJump.maxSkipis now enforced against the runtimefindMaxSkipcap before using skip-based page jumps.dropDatabase()now treatsNODE_ENV=production,prod, andliveas production-like environments that requireallowProduction: true.- Aggregate pipelines ending in
$outor$mergenow bypass aggregate result caching and invalidate the target collection's read caches after successful execution. - Fire-and-forget distributed cache invalidation and transaction timeout abort paths now catch/log failures instead of leaving unhandled rejections.
findPagecursor anchors now read nested dot-path sort fields correctly, query read helpers acceptprojectas a projection alias, and documentation clarifies ObjectIdmaxDepthconversion limits plus process-level Model registration.updateMany(..., { upsert: true })documentation now states MongoDB's native no-match branch inserts only one derived document, so it is not a per-input bulk upsert replacement forupdateBatch.- Added
msq.dataTasksfor bounded production tasks:plan,dryRun,run,verify, plus helper methods for explicit index sync, filtered data sync, field transforms, affected-document snapshots, and verification. - Added the
monsqlize data-taskCLI withplan,dry-run,run, andverifyactions. Production writes require--confirm-production. - Added data task docs, production rollout guidance, API index entries, and a runnable
examples/docs/data-tasks.tsexample.
npm run lintnpm run check:docs-examplesnpm run type-checknpm run check:sizes:strictnpm run test:unitnpm testnpm run test:auditnpm pack --dry-run --json