mongodb - Moongose - how to customize a field in a scheme ? string and array in the same field -


i know how can customize field can use array , string eg:

var postingschema = new schema({     created: {         type: date,         default: date.now     },     title: {         type: string,         required: true,         trim: true     },     images: array,     categorie: array,     ubication:[{ type: number, ref: 'place'}],     agg:[{     agg   :{ type: string, ref: 'agg' },     value : string,     make  :[{ type: number, ref: 'make'}]   }] }); 

in field agg value, have problem can of type string , can of type array , should of array type populate scheme. how can that?

i made field called "value ->string" , "make->array" if there better way?


Comments

Popular posts from this blog

javascript - AngularJS custom datepicker directive -

javascript - jQuery date picker - Disable dates after the selection from the first date picker -