TRIM v17
The TRIM
method removes one or more elements from the end of a collection.
Syntax
The syntax for the TRIM
method is:
Where:
collection
is the name of a collection.
count
is the number of elements removed from the end of the collection. EDB Postgres Advanced Server returns an error if count
is less than 0
or greater than the number of elements in the collection.
Example
This example uses the TRIM
method to remove an element from the end of a collection:
COUNT
indicates that before the TRIM
method, there were five elements in the collection. After the TRIM
method is invoked, the collection contains four elements.
You can also specify the number of elements to remove from the end of the collection using the TRIM
method:
COUNT
indicates that before the TRIM
method, there were five elements in the collection. After the TRIM
method is invoked, the collection contains three elements.