code: def get_mongodb() -> Database:
      """
      Get database in MongoDB, which means you need to declare the address and the name of a database at first.
  
      For example:
  
          Using qlib.init():
  
              .. code-block:: python
  
                  mongo_conf = {
                      "task_url": task_url,  # your MongoDB url
                      "task_db_name": task_db_name,  # database name
                  }
                  qlib.init(..., mongo=mongo_conf)
  
          After qlib.init():
  
              .. code-block:: python
  
                  C["mongo"] = {
                      "task_url" : "mongodb://localhost:27017/",
                      "task_db_name" : "rolling_db"
                  }
  
      Returns:
          Database: the Database instance
      """
      try:
          cfg = C["mongo"]
      except KeyError:
          get_module_logger("task").error(
              "Please configure `C['mongo']` before using TaskManager"
          )
          raise
      get_module_logger("task").info(f"mongo config:{cfg}")
      client = MongoClient(cfg["task_url"])
      return client.get_database(name=cfg["task_db_name"])
  
imports: import bisect
  from copy import deepcopy
  import pandas
  from qlib.data import D
  from qlib.utils import hash_args
  from qlib.utils.mod import init_instance_by_config
  from qlib.workflow import R
  from qlib.config import C
  from qlib.log import get_module_logger
  from pymongo import MongoClient
  from pymongo.database import Database
  from typing import Union
  from pathlib import Path
label_desc: Use image node_id 1 for calling a global function with example usage: get_mongodb() and returns: client