Skip to content

fn:remove removing multiple items #294

Closed

Description

@michaelhkay

map:remove and array:remove take a list of keys/positions to be removed; fn:remove only accepts one. I propose changing fn:remove to bring it into line.

Without this, removing multiple items is tricky because removing one item changes the positions of the others.

Example use case:

let $p := index-where($persons ->{@status='retired'))
return $persons => remove($p)

(Of course, this could always be done with a filter. But removing a small number of items from a large sequence might be more efficient than a filter)

Activity

  1. added
    XQFOAn issue related to Functions and Operators
    EnhancementA change or improvement to an existing feature
    on Dec 20, 2022
  2. michaelhkay commented on Jan 25, 2023

    @michaelhkay
    ContributorAuthor

    The change has been implemented.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    EnhancementA change or improvement to an existing featureXQFOAn issue related to Functions and Operators

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions