These are chat archives for Automattic/mongoose

Jan 2017
Murat Sutunc
Jan 31 2017 09:30

quick question.. I have a model which looks like this:

const someSchema = new mongoose.Schema({
  // type
  myType: String,
  body: Object
}, { timestamps: true });

I know the shape of different types of bodies. Is using custom schemas the only way to validate the contents in my case?