These are chat archives for Automattic/mongoose

31st
Jan 2017
Murat Sutunc
@muratsu
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?