mongokit
mongokit copied to clipboard
Method find() bug in nested structure
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 ?