To specify an arbitrary object (ie, "everything goes") in your schema, you can use the Mixed type or just {} .
var activity: new Schema({ date: Date, user: String, action: String, detail: Schema.Types.Mixed, meta: {} // equivalent to Schema.Types.Mixed });
Trap
However, for added flexibility, there is a catch. When using Mixed (or {} ), you need to explicitly tell mongoose that you made such changes:
activity.detail.title = "title"; activity.markModified('detail'); activity.save();
A source
Ryanm
source share