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

Method find() bug in nested structure #192

Open
douglarek opened this issue Sep 28, 2014 · 0 comments
Open

Method find() bug in nested structure #192

douglarek opened this issue Sep 28, 2014 · 0 comments

Comments

@douglarek
Copy link

class EmployeeDocument(BaseDocument):
    __collection__ = 'employees'

    structure = {
        'name': unicode,
        'uid': basestring,
        'password': basestring,
        'hirer': {'name': unicode, 'token': basestring}
    }

Use find() to query, nothing found as this:

db.EmployeeDocument.find({'hirer': {'name': g.user, 'token': {'$exists': True}}})

but it works as this:

db.EmployeeDocument.find({'hirer': {'name': g.user, 'token': session.get('token')}})

Anything I missed ?

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