question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Filtering arrays inside $map

See original GitHub issue

Hi 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:closed
  • Created 3 years ago
  • Comments:5 (2 by maintainers)

github_iconTop GitHub Comments

1reaction
avifatalcommented, Sep 30, 2020
0reactions
mattbaileyukcommented, Sep 30, 2020

@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.

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found