def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def matchfn(self, f):
        for match in self._matchers:
            if match(f):
                return True
        return False