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.

Ability to select map keys

See original GitHub issue

It seems that there is no way to select key set from a map element

E.g.

{
    "person" : {
        "name" : "Andrew",
        "age" : 23
    }
}

How to get values [ ‘name’, ‘age’ ] ? Now, expression $.person[*] returns values [ ‘Andrew’, 23 ]

Are there any blockers to implement this feature? If it should be implemented, what is the right syntax? Maybe $.person[$$] or $.person.keys()

@kallestenflo , take a look please

Issue Analytics

  • State:open
  • Created 6 years ago
  • Reactions:36
  • Comments:7 (1 by maintainers)

github_iconTop GitHub Comments

13reactions
shaunstonecommented, Dec 3, 2018

$.person[*~] seems to work in the online jsonpath evaluator. (jsonpath.com).

4reactions
hf-kkleincommented, Dec 3, 2018

@shaunstone Seems like jsonpath.com is using another implementation of JsonPath, but not this one.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Step 2 - Choose Map Key - IBM
Choose primary map key. Select the attribute that is the primary key for identifying and labeling features in the map. For example, a...
Read more >
Map and Set - The Modern JavaScript Tutorial
map.has(key) – returns true if the key exists, false otherwise. map.delete(key) – removes the element (the key/value pair) by the key. map.clear ...
Read more >
Filtering a map based on expected keys - clojure
In my Clojure webapp I have various model namespaces with functions that take a map as an agrument and somehow insert that map...
Read more >
Selecting a single value from a map - Google Groups
Many things are possible to select from (or do to) a map, but the ability to select single value by key seems to...
Read more >
Maps of sObjects | Apex Developer Guide
Map keys and values can be of any data type, including sObject types, such as Account. Maps can hold sObjects both in their...
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