`; PostgreSQL only) * * @param string $tableName The name of the table in which documents should be counted * @param array|object $criteria The criteria for the JSON containment query * @return int The number of documents matching the JSON containment query * @throws DocumentException If the database mode is not PostgreSQL, or if an error occurs */ public static function byContains(string $tableName, array|object $criteria): int { return Custom::scalar(Query\Count::byContains($tableName), Parameters::json(':criteria', $criteria), new CountMapper()); } /** * Count matching documents using a JSON Path match query (`@?`; PostgreSQL only) * * @param string $tableName The name of the table in which documents should be counted * @param string $path The JSON Path match string * @return int The number of documents matching the given JSON Path criteria * @throws DocumentException If the database mode is not PostgreSQL, or if an error occurs */ public static function byJsonPath(string $tableName, string $path): int { return Custom::scalar(Query\Count::byJsonPath($tableName), [':path' => $path], new CountMapper()); } }