class_docstr: This handler handles connection and execution of the MongoDB statements.
class_docstr_tok: ["This","handler","handles","connection","and","execution","of","the","MongoDB","statements","."]
code: def __init__(self, name, **kwargs):
      super().__init__(name)
      connection_data = kwargs["connection_data"]
      self.host = connection_data.get("host")
      self.port = int(connection_data.get("port") or 27017)
      self.user = connection_data.get("username")
      self.password = connection_data.get("password")
      self.database = connection_data.get("database")
      self.flatten_level = connection_data.get("flatten_level", 0)
  
      self.connection = None
      self.is_connected = False
  
imports: import re
  import time
  from collections import OrderedDict
  from bson import ObjectId
  import certifi
  import pandas
  import pymongo
  from pymongo import MongoClient
  from mindsdb_sql.parser.ast.base import ASTNode
  from mindsdb.utilities import log
  from mindsdb.integrations.libs.base import DatabaseHandler
  from mindsdb.integrations.libs.const import HANDLER_CONNECTION_ARG_TYPE
  from mindsdb.integrations.libs.response import HandlerStatusResponse, HandlerResponse, RESPONSE_TYPE
  from .utils.mongodb_render import MongodbRender
  from mindsdb.api.mongo.utilities.mongodb_query import MongoQuery
  from mindsdb.api.mongo.utilities.mongodb_parser import MongodbParser
label_desc: Use image node_id 1 to create a new MongoDBHandler object from inherited base classes: DatabaseHandler with example: obj = MongoDBHandler(name)