Filtering arrays inside $map
See original GitHub issueHi I am trying to filter out a property from json while building result inside $map
{
"nodes": [
{
"field_type": "a",
"text": "test_a"
},
{
"field_type": "b",
"text": "test_b"
},
{
"field_type": "b",
"text": "test1_c"
}
]
}
I want to return only a and c. and remove b. this is what I have so far: https://try.jsonata.org/Oz9umE30F Thanks
Issue Analytics
- State:
- Created 3 years ago
- Comments:5 (2 by maintainers)
Top Results From Across the Web
Map and filter an array at the same time - Stack Overflow
The most efficient way of doing filter + map at once is to process data as a generic ...
Read more >How to use map and filter simultaneously on an array using ...
filter () method: This method returns a new array containing the elements that passes a certain test performed on an original array. ·...
Read more >Simplify your JavaScript – Use .map(), .reduce(), and .filter()
Simplify the way you write your JavaScript by using .map(), .reduce() and .filter() instead of for() and forEach() loops.
Read more >Using JavaScript `map()` and `filter()` Together for Composition
JavaScript's Array#map() and Array#filter() functions are great when used together because they allow you to compose simple functions.
Read more >How to Use Map, Filter, and Reduce in JavaScript - Code
map creates a new array by transforming every element in an array individually. filter creates a new array by removing elements that don't ......
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
@andrew-coleman
@avifatal You haven’t provided much detail on your new problem, and why the solution that @andrew-coleman provided to your original issue does not work.
From an etiquette point of view, angry emojis are not helpful to the conversation.