docs: def find_collections(
          self,
          search_pattern="",
          identifier="",
          fetched=0,
          page=1,
          page_size=30,
          sort_by=None,
      ):
          """
          Fetches a list of all resource IDs for every resource in the database.
  
          :param string search_pattern: A search pattern to use in looking up resources by title or resourceid.
              The search will match any title or resourceid containing this string;
              for example, "text" will match "this title has this text in it".
              If omitted, then all resources will be fetched.
          :param string identifier: Restrict records to only those with this identifier.
              This refers to the human-assigned record identifier, not the automatically generated internal ID.
              This value can contain wildcards.
  
          :return: A list containing every matched resource's ID.
          :rtype: list
          """
  
          def format_record(record):
              # Get record details
              full_record = self.get_record(record["slug"])
              dates = self._fetch_dates_from_record(record)
              date_expression = self._fetch_date_expression_from_record(record)
  
              # Determine whether descendents exist
              url = urljoin(
                  self.base_url, "informationobjects/tree/{}".format(record["slug"])
              )
              tree = self._get(url).json()
              if "children" in tree:
                  has_children = len(self._get(url).json()["children"]) > 0
              else:
                  has_children = False
  
              formatted = {
                  "id": record["slug"],
                  "type": "resource",
                  "sortPosition": 1,
                  "identifier": record.get("reference_code", ""),
                  "title": record.get("title", ""),
                  "dates": dates,
                  "date_expression": date_expression,
                  "children": [] if has_children else False,
                  "has_children": has_children,
                  "notes": full_record.get("notes", []),
              }
  
              if "level_of_description" in record:
                  formatted["levelOfDescription"] = record["level_of_description"]
  
              return formatted
  
          response = self._collections_search_request(
              search_pattern, identifier, page, page_size, sort_by
          )
          hits = response.json()
          return [format_record(r) for r in hits["results"]]