def save(self, doc):
        if doc.id:
            return self.update(doc)
        else:
            return self.insert(doc)
def values(self):
        for value in self._collection.values():
            yield self._to_python(value)