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