unique
Summary
Returns the input array without duplicate elements.Usage
input|unique()
Returns
The input array containing only one occurance of every element.Description
This operator removes duplicate elements from the input array.
Examples
Example 1
{array( 1, 2, 2, 3, 4, 4, 5 )|unique}
The following array will be returned: ( 1, 2, 3, 4, 5 ).
Balazs Halasy (05/02/2004 9:34 am)
Balazs Halasy (04/05/2005 1:41 pm)
Comments
What about objects, nodes ?
Tuesday 27 February 2007 4:09:39 pm
P. Renaud
produces the following output :
You have to build an intermediate array with node id's, then use unique, then re-fetch all nodes...