code: def db_exists(name, user=None, password=None, host=None, port=None, authdb=None):
      '''
      Checks if a database exists in MongoDB
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' mongodb.db_exists <name> <user> <password> <host> <port>
      '''
      dbs = db_list(user, password, host, port, authdb=authdb)
  
      if isinstance(dbs, six.string_types):
          return False
  
      return name in dbf db_exists(name, user=None, password=None, host=None, port=None, authdb=None):
      '''
      Checks if a database exists in MongoDB
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' mongodb.db_exists <name> <user> <password> <host> <port>
      '''
      dbs = db_list(user, password, host, port, authdb=authdb)
  
      if isinstance(dbs, six.string_types):
          return False
  
      return name in dbs
docs: Checks if a database exists in MongoDB
  
      CLI Example:
  
      .. code-block:: bash
  
          salt '*' mongodb.db_exists <name> <user> <password> <host> <port>