Skip to content
This repository has been archived by the owner on Jul 14, 2020. It is now read-only.

Specifying keys in embedded doc in list as required #230

Closed
eikawata opened this issue Feb 7, 2015 · 0 comments
Closed

Specifying keys in embedded doc in list as required #230

eikawata opened this issue Feb 7, 2015 · 0 comments

Comments

@eikawata
Copy link

eikawata commented Feb 7, 2015

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.

@eikawata eikawata changed the title Specifying keys in embedded doc as required Specifying keys in embedded doc in list as required Feb 7, 2015
@eikawata eikawata closed this as completed Feb 7, 2015
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant