A nested/recursive pluck() #45980
Unanswered
msacharewicz
asked this question in
Ideas
Replies: 0 comments
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
The Collection lacks a method to pluck values recursively.
There are many scenarios, in which we operate on Collection-stored trees. Such trees contain a recursively-nested nodes, with same properties each, for example:
Currently, there is no method on Collection to simply pluck all values of the same key from the entire collection.
Consider following macro implementation to better understand the feature:
Usage:
Result:
(we do not need uniqueness, we have
unique()
for that)While macros are a fine workaround, they bring their own issues. Would it be possible to implement such function in the core?
Beta Was this translation helpful? Give feedback.
All reactions