Can a reference field in a Mongoose schema pertain to more than one data model?

Hi,

Can you try to use Mixed:

const documentSchema = Schema({
  _id: Schema.Types.ObjectId,
  title: String,
  date: Date,
  references: [{ type: Schema.Types.Mixed }]
});
2 Likes