def fetch(self, spec=None, *args, **kwargs):
        """
        return all document which match the structure of the object
        `fetch()` takes the same arguments than the the pymongo.collection.find method.
        The query is launch against the db and collection of the object.
        """
        if spec is None:
            spec = {}
        for key in self.structure:
            if key in spec:
                if isinstance(spec[key], dict):
                    spec[key].update({'$exists': True})
            else:
                spec[key] = {'$exists': True}
        return self.find(spec, *args, **kwargs)
def fetch ( self , spec = None , * args , ** kwargs ) : if spec is None : spec = { } for key in self . structure : if key in spec : if isinstance ( spec [ key ] , dict ) : spec [ key ] . update ( { '$exists' : True } ) else : spec [ key ] = { '$exists' : True } return self . find ( spec , * args , ** kwargs )
return all document which match the structure of the object
        `fetch()` takes the same arguments than the the pymongo.collection.find method.
        The query is launch against the db and collection of the object.