4.3.2.4. List functions


The following functions support list operations.

注記

In FEEL, the index of the first element in a list is 1. The index of the last element in a list can be identified as -1.

list contains( list, element )

Returns true if the list contains the element.

Expand
表4.28 Parameters
ParameterType

list

list

element

Any type, including null

Example

list contains( [1,2,3], 2 ) = true

count( list )

Counts the elements in the list.

Expand
表4.29 Parameters
ParameterType

list

list

Examples

count( [1,2,3] ) = 3
count( [] ) = 0
count( [1,[2,3]] ) = 2

min( list )

Returns the minimum comparable element in the list.

Expand
表4.30 Parameters
ParameterType

list

list

Alternative signature

min( e1, e2, ..., eN )

Examples

min( [1,2,3] ) = 1
min( 1 ) = 1
min( [1] ) = 1

max( list )

Returns the maximum comparable element in the list.

Expand
表4.31 Parameters
ParameterType

list

list

Alternative signature

max( e1, e2, ..., eN )

Examples

max( 1,2,3 ) = 3
max( [] ) = null

sum( list )

Returns the sum of the numbers in the list.

Expand
表4.32 Parameters
ParameterType

list

list of number elements

Alternative signature

sum( n1, n2, ..., nN )

Examples

sum( [1,2,3] ) = 6
sum( 1,2,3 ) = 6
sum( 1 ) = 1
sum( [] ) = null

mean( list )

Calculates the average (arithmetic mean) of the elements in the list.

Expand
表4.33 Parameters
ParameterType

list

list of number elements

Alternative signature

mean( n1, n2, ..., nN )

Examples

mean( [1,2,3] ) = 2
mean( 1,2,3 ) = 2
mean( 1 ) = 1
mean( [] ) = null

all( list )

Returns true if all elements in the list are true.

Expand
表4.34 Parameters
ParameterType

list

list of boolean elements

Alternative signature

all( b1, b2, ..., bN )

Examples

all( [false,null,true] ) = false
all( true ) = true
all( [true] ) = true
all( [] ) = true
all( 0 ) = null

any( list )

Returns true if any element in the list is true.

Expand
表4.35 Parameters
ParameterType

list

list of boolean elements

Alternative signature

any( b1, b2, ..., bN )

Examples

any( [false,null,true] ) = true
any( false ) = false
any( [] ) = false
any( 0 ) = null

sublist( list, start position, length? )

Returns the sublist from the start position, limited to the length elements.

Expand
表4.36 Parameters
ParameterType

list

list

start position

number

length (Optional)

number

Example

sublist( [4,5,6], 1, 2 ) = [4,5]

append( list, item )

Creates a list that is appended to the item or items.

Expand
表4.37 Parameters
ParameterType

list

list

item

Any type

Example

append( [1], 2, 3 ) = [1,2,3]

concatenate( list )

Creates a list that is the result of the concatenated lists.

Expand
表4.38 Parameters
ParameterType

list

list

Example

concatenate( [1,2],[3] ) = [1,2,3]

insert before( list, position, newItem )

Creates a list with the newItem inserted at the specified position.

Expand
表4.39 Parameters
ParameterType

list

list

position

number

newItem

Any type

Example

insert before( [1,3],1,2 ) = [2,1,3]

remove( list, position )

Creates a list with the removed element excluded from the specified position.

Expand
表4.40 Parameters
ParameterType

list

list

position

number

Example

remove( [1,2,3], 2 ) = [1,3]

reverse( list )

Returns a reversed list.

Expand
表4.41 Parameters
ParameterType

list

list

Example

reverse( [1,2,3] ) = [3,2,1]

index of( list, match )

Returns indexes matching the element.

Parameters

  • list of type list
  • match of any type
Expand
表4.42 Parameters
ParameterType

list

list

match

Any type

Example

index of( [1,2,3,2],2 ) = [2,4]

union( list )

Returns a list of all the elements from multiple lists and excludes duplicates.

Expand
表4.43 Parameters
ParameterType

list

list

Example

union( [1,2],[2,3] ) = [1,2,3]

distinct values( list )

Returns a list of elements from a single list and excludes duplicates.

Expand
表4.44 Parameters
ParameterType

list

list

Example

distinct values( [1,2,3,2,1] ) = [1,2,3]

flatten( list )

Returns a flattened list.

Expand
表4.45 Parameters
ParameterType

list

list

Example

flatten( [[1,2],[[3]], 4] ) = [1,2,3,4]

product( list )

Returns the product of the numbers in the list.

Expand
表4.46 Parameters
ParameterType

list

list of number elements

Alternative signature

product( n1, n2, ..., nN )

Examples

product( [2, 3, 4] ) = 24
product( 2, 3, 4 ) = 24

median( list )

Returns the median of the numbers in the list. If the number of elements is odd, the result is the middle element. If the number of elements is even, the result is the average of the two middle elements.

Expand
表4.47 Parameters
ParameterType

list

list of number elements

Alternative signature

median( n1, n2, ..., nN )

Examples

median( 8, 2, 5, 3, 4 ) = 4
median( [6, 1, 2, 3] ) = 2.5
median( [ ] ) = null

stddev( list )

Returns the standard deviation of the numbers in the list.

Expand
表4.48 Parameters
ParameterType

list

list of number elements

Alternative signature

stddev( n1, n2, ..., nN )

Examples

stddev( 2, 4, 7, 5 ) = 2.081665999466132735282297706979931
stddev( [47] ) = null
stddev( 47 ) = null
stddev( [ ] ) = null

mode( list )

Returns the mode of the numbers in the list. If multiple elements are returned, the numbers are sorted in ascending order.

Expand
表4.49 Parameters
ParameterType

list

list of number elements

Alternative signature

mode( n1, n2, ..., nN )

Examples

mode( 6, 3, 9, 6, 6 ) = [6]
mode( [6, 1, 9, 6, 1] ) = [1, 6]
mode( [ ] ) = [ ]

Red Hat logoGithubredditYoutubeTwitter

詳細情報

試用、購入および販売

コミュニティー

Red Hat ドキュメントについて

Red Hat をお使いのお客様が、信頼できるコンテンツが含まれている製品やサービスを活用することで、イノベーションを行い、目標を達成できるようにします。 最新の更新を見る.

多様性を受け入れるオープンソースの強化

Red Hat では、コード、ドキュメント、Web プロパティーにおける配慮に欠ける用語の置き換えに取り組んでいます。このような変更は、段階的に実施される予定です。詳細情報: Red Hat ブログ.

会社概要

Red Hat は、企業がコアとなるデータセンターからネットワークエッジに至るまで、各種プラットフォームや環境全体で作業を簡素化できるように、強化されたソリューションを提供しています。

Theme

© 2026 Red Hat
トップに戻る