class_docstr: MongoDB TaskRecord backend.
class_docstr_tok: ["MongoDB","TaskRecord","backend","."]
code: def __init__(self, **kwargs):
      super().__init__(**kwargs)
      if self._connection is None:
          self._connection = MongoClient(
              *self.connection_args, **self.connection_kwargs
          )
      if not self.database:
          self.database = self.session
      self._db = self._connection[self.database]
      self._records = self._db["task_records"]
      self._records.ensure_index("msg_id", unique=True)
      self._records.ensure_index("submitted")
  
file_path: ipyparallel/ipyparallel/controller/mongodb.py
imports: from traitlets import Dict, Instance, List, Unicode
  from .dictdb import BaseDB
label_desc: Use image node_id 1 to create a new MongoDB object from inherited base classes: BaseDB with example: obj = MongoDB()