Bonjour,
Je voudrais déclarer un tableau de chaines dans un champ d’un document avec SimpleSchema.
Clients.attachSchema(new SimpleSchema({
…
“cli_comment”: {type:String,optional:true},
“cli_keyCliFac”: [{“keyCliFac”:String,optional:true}]. // optional:true pour pouvoir avoir un tableau vide
}));
when you do: "cli_keyCliFac": {type:[Object]}, "cli_keyCliFac.keyCliFac":{type:String,optional:true}
you are declaring a array of objects, do this instead: "cli_keyCliFac": {type:Object}, "cli_keyCliFac.keyCliFac":{type:String,optional:true}
Hey @yvancoyaud I would hazard a guess that you are using the npm version of simpl-schema? The syntax changed a bit to the atmosphere version. If indeed you are, then according to the docs you may use [Object] only in shorthand declarations. Otherwise, you will have to declare it like so (from the docs):