class_docstr: The MongoDatabaseAdapter is an interface that allows
  ChatterBot to store statements in a MongoDB database.
  
  :keyword database_uri: The URI of a remote instance of MongoDB.
                         This can be any valid
                         `MongoDB connection string <https://docs.mongodb.com/manual/reference/connection-string/>`_
  :type database_uri: str
  
  .. code-block:: python
  
     database_uri='mongodb://example.com:8100/'
class_docstr_tok: ["The","MongoDatabaseAdapter","is","an","interface","that","allows","ChatterBot","to","store","statements","in","a","MongoDB","database",".",":","keyword","database_uri",":","The","URI","of","a","remote","instance","of","MongoDB",".","This","can","be","any","valid","`","MongoDB","connection","string","<","https",":","\/\/docs.mongodb.com\/manual\/reference\/connection-string\/",">","`","_",":","type","database_uri",":","str","..","code-block",":",":","python","database_uri='mongodb",":","\/\/example.com:8100\/","'"]
code: def __init__(self, **kwargs):
      super().__init__(**kwargs)
      from pymongo import MongoClient
      from pymongo.errors import OperationFailure
  
      self.database_uri = kwargs.get(
          "database_uri",
          "mongodb://localhost:27017/chatterbot-database",
      )
  
      # Use the default host and port
      self.client = MongoClient(self.database_uri)
  
      # Increase the sort buffer to 42M if possible
      try:
          self.client.admin.command(
              {
                  "setParameter": 1,
                  "internalQueryExecMaxBlockingSortBytes": 44040192,
              }
          )
      except OperationFailure:
          pass
  
      # Specify the name of the database
      self.database = self.client.get_database()
  
      # The mongo collection of statement documents
      self.statements = self.database["statements"]
  
file_path: ChatterBot/chatterbot/storage/mongodb.py
imports: import re
  from chatterbot.storage import StorageAdapter
label_desc: Use image node_id 1 to create a new MongoDatabaseAdapter object from inherited base classes: StorageAdapter with example: obj = MongoDatabaseAdapter()