public int getDatabaseNum(
      final PartialPath pathPattern, final PathPatternTree scope, final boolean isPrefixMatch)
      throws MetadataException {
    try (final DatabaseCounter<IConfigMNode> counter =
        new DatabaseCounter<>(root, pathPattern, store, isPrefixMatch, scope)) {
      return (int) counter.count();
    }
  }
Get the count of database matching the given path. If using prefix match, the path pattern is
used to match prefix path. All timeseries start with the matched prefix path will be counted.

@param pathPattern a path pattern or a full path, may contain wildcard.
@param scope traversing scope
@param isPrefixMatch if true, the path pattern is used to match prefix path
iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/persistence/schema/ConfigMTree.java