LearnBoost/mongoose — Issue #740: required: true on objectId causes the validation to fail
Author: jtlebi
Created: 2012-02-17 17:46:01+00:00
State: open

I have a Schema that contains a Ref to another one. If I mark it as required, to validation fails. Without this attributes, everything go fine, including the ref.

Here is the actual Schema

```js
answerChoiceSchema = new schema {
propositionId: { type: objectId, required: true},
dispo: { type: String, required: true, enum: ['yes', 'no']}
}
```

and an extract of my code

```js
//c comes directly from a POST key/value array which just fine
choice = new Choice
choice.propositionId = c.propositionId
choice.dispo = c.dispo
answer.choices.push choice
```
I do not know if this is of any help to find the issue but "choice" data comes at 3rd level of nesting (parent->answers->choices)

What can I do about it ?