class_docstr: Wrap MongoDB with three primary methods `read`, `write`, `remove`.
  
  Attributes
  ----------
  host : str
     Hostname or MongoDB compliant full credentials+address+database
     specification.
  
  Information on MongoDB `connection string
  <https://docs.mongodb.com/manual/reference/connection-string/>`_.
  
  .. seealso:: :class:`orion.core.io.database.Database` for more on attributes.
docstr: Sanitize attributes using MongoDB's 'uri_parser' module.
docstr_tok: ["Sanitize","attributes","using","MongoDB","'s","'uri_parser","'","module","."]
code: def _sanitize_attrs(self):
      """Sanitize attributes using MongoDB's 'uri_parser' module."""
      try:
          # Host can be a valid MongoDB URI
          settings = pymongo.uri_parser.parse_uri(
              self.host, default_port=self.port
          )
      except pymongo.errors.InvalidURI:  # host argument was a hostname
          if self.port is None:
              self.port = pymongo.MongoClient.PORT
      else:  # host argument was a URI
          # Arguments in MongoClient overwrite elements from URI
  
          self.uri = self.host
          self.host, _port = settings["nodelist"][0]
          if settings["database"] is not None:
              self.name = settings["database"]
          if _port is not None:
              self.port = _port
          if settings["username"] is not None:
              self.username = settings["username"]
          if settings["password"] is not None:
              self.password = settings["password"]
  
          # Use new self.name if authSource not specified in URI
          self.options["authSource"] = settings["options"].get(
              "authsource", self.name
          )
  
imports: import functools
  import pymongo
  from orion.core.io.database import Database, DatabaseError, DatabaseTimeout, DuplicateKeyError
label_desc: Use image node_id 18 for calling the MongoDB obj's underlying member method code with example usage: obj._sanitize_attrs() without return types