def query(self):
        """A mongdb query expression to find all records with higher values
        for this mark's fields in the collection.

        :rtype: dict
        """
        q = {}
        for field, value in self._pos.items():
            if value is None:
                q.update({field: {'$exists': True}})
            else:
                q.update({field: {'$gt': value}})
        return q
def query ( self ) : q = { } for field , value in self . _pos . items ( ) : if value is None : q . update ( { field : { '$exists' : True } } ) else : q . update ( { field : { '$gt' : value } } ) return q
A mongdb query expression to find all records with higher values
        for this mark's fields in the collection.

        :rtype: dict