Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: SUP-354

The method element can only be invoked on a value of type set. It should only be used on a set that has exactly one element. The method then returns this element, which otherwise could only be extracted by traversing the set with forall , or using toList to turn the set into a list (and use its method last or operator [1] to fetch the element):

Script template

<result> = < set > . element ()  


<set>

A value of type se t or an expression evaluating to a value of that type.

<result>

A value of any type: the single element in the set.


When the set is empty, this method will raise an error. When the set contains more than one element, a warning is issued and the method will return one of the elements from the set.



Content by Label
showLabelsfalse
max6
showSpacefalse
titleRelated articles
cqllabel = "methods-strings" AND label not in ("troubleshooting","archive") and space = "knowledge"