Skip to main content

Select New Documents by createdDate

Version: 1.0.0 Date: 2026-07-15

Goal: Neo-backend, Tower v2, and automation scripts write createdDate only. Forge fetch-new-docs filtered on legacy Mongoose created, so those documents were never picked for anchoring (admin showed 0/0 confirmed).

Solution: Match and project createdDate in the protect aggregation pipeline. No DB migration needed — legacy manual deposits already have createdDate.

Features:

  • $match: { createdDate: { $gt: new Date(startTime) } } replaces created
  • $project exposes createdDate instead of created
  • Unit tests assert pipeline stages

Implementation Details:

  • Documents without createdDate (extremely old edge case) remain excluded — all production manual deposits already carry createdDate
  • Aligns with neo-backend stats fix (createdDate in aggregations) and backend JSON proxy (createdcreatedDate)

Files Modified:

  • src/database/requests/fetch-new-docs.ts - Pipeline field rename
  • src/database/requests/fetch-new-docs.spec.ts - Pipeline tests (new)

Release fragment: fix-forge-created-date