The silent ignorer

If a field exists in the TypeScript interface but not in the Mongoose schema, Mongoose silently drops it on save(). No error, no warning — the field just disappears after the save/reload cycle.

// ✅ TypeScript interface — type safety only, compile-time
interface Session {
  vehicle_license_plate: string
}
 
// ❌ Missing from Mongoose schema — field will be silently ignored on save
const SessionSchema = new Schema({
  // vehicle_license_plate is not here
})

The fix

Add the field to the schema:

const SessionSchema = new Schema({
  vehicle_license_plate: String,  // must be here for persistence
})

Unlike Java’s @Transient

Mongoose has only two states: in schema (saved) or not in schema (silently ignored). There’s no concept of a transient field that exists in memory but doesn’t persist.

When adding a new field, always check both:

  1. TypeScript interface (type safety)
  2. Mongoose schema (actual persistence)