Inserts the data as a new document.

def insert(self, data, return_object=False):
        """ Inserts the data as a new document. """

        obj = self(data)  # pylint: disable=E1102
        obj.save()

        if return_object:
            return obj
        else:
            return obj["_id"]