def METHOD_NAME(self):
    """ Return in the same format as was stored in MongoDB """
    versions = {}
    for branch in ("draft", "published", "library"):
        # The current version of this branch, a hex-encoded ObjectID - or an empty string:
        version_str = getattr(self, f"{branch}_version")
        if version_str:
            versions[getattr(ModuleStoreEnum.BranchName, branch)] = ObjectId(version_str)
    return {
        "_id": ObjectId(self.objectid),
        "org": self.course_id.org,
        "course": get_library_or_course_attribute(self.course_id),
        "run": self.course_id.run,  # pylint: disable=no-member
        "edited_by": self.edited_by_id,
        "edited_on": self.edited_on,
        "last_update": self.last_update,
        "versions": versions,
        "schema_version": 1,  # This matches schema version 1, see SplitMongoModuleStore.SCHEMA_VERSION
        "search_targets": {"wiki_slug": self.wiki_slug},
    }