Lets' say I have a following structure.
class MyDoc(Document):
structure = {
'sections': [{
'title': unicode,
'description': unicode
}]
}
required_fields = []
How do I specify description
as a require field? sections.description
or sections.$.description
does not work.
I asked the same question here, but I was a bit surprised this feature is not supported.
This seems to be such a common scenario. I could potentially extract embedded docs out to a separate collection, but that defeats the purpose of choosing MongoDB for me because I was looking to have everything (which isn't a lot) under one document and avoid multiple queries.