code: def up(self) -> None:
      # See https://docs.mongoengine.org/guide/migration.html#example-1-addition-of-a-field
      logging.info(
          "If missing, add 'job_runner_version' field based on 'worker_version' value"
      )
      db = get_db(CACHE_MONGOENGINE_ALIAS)
      db[CACHE_COLLECTION_RESPONSES].update_many(
          {"job_runner_version": {"$exists": False}},
          [
              {
                  "$set": {
                      "job_runner_version": {
                          "$convert": {
                              "input": {
                                  "$first": {
                                      "$split": ["$worker_version", "."]
                                  }
                              },
                              "to": "int",
                              "onError": None,
                              "onNull": None,
                          }
                      }
                  }
              }
          ],  # type: ignore
      )
  
file_path: datasets-server/jobs/mongodb_migration/src/mongodb_migration/migrations/_20230309141600_cache_add_job_runner_version.py
imports: import logging
  from libcommon.constants import CACHE_COLLECTION_RESPONSES, CACHE_MONGOENGINE_ALIAS
  from libcommon.simple_cache import CachedResponseDocument
  from mongoengine.connection import get_db
  from mongodb_migration.check import check_documents
  from mongodb_migration.migration import Migration
label_desc: Use image node_id 1 for calling the MigrationAddJobRunnerVersionToCacheResponse obj's underlying member method code with example usage: obj.up() without return types