Skip to main content
Version: 1.7.0

Legacy Document Timestamps (created vs createdDate)

Overview

Compatibility layer between neo-backend document inserts and legacy API consumers (IP Magic Box, admin lists). Neo and Tower v2 write createdDate only; legacy Mongoose documents used both created and createdDate.

How it works

On JSON serialization (toObject / toJSON) and in document list routes, when created is missing but createdDate is present, the API exposes created as an alias of createdDate.

Downstream services that query Mongo directly (e.g. Forge fetch-new-docs) must filter on createdDate, not legacy created.

Key files

  • app/database/schema/document.js — Transform hooks set ret.created = ret.createdDate when needed
  • app/routes/documents.js — List payloads include created: d.created ?? d.createdDate

Technical decisions

  • Read-time proxy, no backfill: Avoids a mass migration; legacy manual deposits already have createdDate.
  • Write path unchanged for manual deposit: IP Magic Box still sets createdDate on POST /documents.

Known issues

  • Raw Mongo documents from neo may still lack a created field until read through the API layer.

Next steps

  • Align all internal aggregations on createdDate as the canonical field