Mongokit How do I specify a key in a dict which is in a list as a required field?

72 Views Asked by At

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?

1

There are 1 best solutions below

1
datasci On