code: def add_path(self, path, pattern="*.json"):
          
          if os.path.isdir(path):
              configs = glob.glob(_opj(path, pattern))
          else:
              configs = [path]
          for config in configs:
                  cfg = dbconfig.DBConfig(config_file=config)
                  cs = cfg.settings
                  if dbconfig.DB_KEY not in cs:
                      raise ValueError("No database in '{}'".format(config))
                  if dbconfig.COLL_KEY in cs:
                      name = "{}.{}".format(cs[dbconfig.DB_KEY],
                                            cs[dbconfig.COLL_KEY])
                  else:
                      name = cs[dbconfig.DB_KEY]
                  self.add(name, cfg)
          return self
docs: Add configuration file(s)
          in `path`. The path can be a single file or a directory.
          If path is a directory, then `pattern`
          (Unix glob-style) will be used to get a list of all config
          files in the directory.
  
          The name given to each file is the database name
          and collection name (if any) combined with a '.'.
  
          :param path: File or directory name
          :return: self, for chaining