I'm using mongokit and I have a structure similar to this in my document.
class MyDoc(Document):
structure = {
'sections': [{
'title': unicode,
'description': unicode
}]
}
required_fields = []
I want to make description
a required field in this document. I know nested keys can be accessed via the dot notation, but sections.description
does not work. How do I achieve what I want?
You may want to try sections.$.description
http://docs.mongodb.org/manual/reference/operator/update/positional/
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.