These are chat archives for Automattic/mongoose

Mar 2016
Mar 09 2016 13:03 UTC
Hello All
i am very new in mongoose
i have requirment something like. i have 4 requird field in mongoose schemabut i want to validate only 2 field during save . other field data will be saved during update. hlow can i do that?
can any one help me on this problem? when i am going to save 2 field it return errors with all the required fields in the schema
Seo ji woong
Mar 09 2016 13:18 UTC
@souravhijli 'validate' means type validation?
if you so, how about 'mongoose.Schema.Types.Mixed'?
it can use any type
Seo ji woong
Mar 09 2016 13:31 UTC
how about use 'required' in schema?
Mar 09 2016 15:10 UTC
Guys mongoose-extend module is really bugged (for example population doesn't work fine), I have lost a lot of time on that. I still want to use inheritance but I don't want to allow the users to save new "root" models..what's the best pratice? (is it clear??:))
Mar 09 2016 17:41 UTC
more important: using inherited schemas there is a way to use the wildcard text index (for each schema)?