Comments (1)
The problem arises because dots are typically used as delimiters in JSONPath expressions, so having a key with a dot in it can lead to unexpected behavior.
In this case, since your key is "item.thing," it is being interpreted as a nested structure. You've tried escaping the dot with quotes, but it seems that the filter function is causing complications.
One way to approach this is to use the bracket notation to access the property. Here's an example that might work for your case:
json
['item.thing'][?(@.key=="match")].value
This way, you are treating "item.thing" as a single key rather than a nested structure. The bracket notation can help in cases where the key contains special characters like dots.
Your expression might look like this:
json
['item.thing'][?(@.key=="match")].value.get(0)=='b'
This assumes that the JSONPath library you are using supports the bracket notation for keys.
If this doesn't work, you might need to refer to the documentation or specific implementation details of the JSONPath library you are using to see if there are any special considerations or syntax for handling keys with dots. If the library supports escaping characters in keys, check for the correct syntax according to its documentation.
from jsonpath.
Related Issues (20)
- Remove Analytics image from README
- Trailing newline character in path is not handled
- How to get the first element after filtering?
- It can not work if i use array index after ?(@ expression HOT 1
- Update the deps with a deps bot?
- Issue with Version 2.8 - JsonPath.java#set() and JsonPath.java#add() HOT 2
- get null when element not exists
- json-path-2.2.0.jar library vulnerability HOT 2
- will we see a YAML Path library? HOT 1
- The number read is counted by Scientific notation
- .set() method should add the key value if its not present HOT 1
- Support XPATH function substring-before,substring-after,translate
- Union of missing properties returns empty object
- Add support for custom Functions registration
- changelog.md is not updated HOT 1
- Provides transitive vulnerable dependency maven:com.jayway.jsonpath:json-path:2.8.0 CVE-2023-51074 5.3 Out-of-bounds Write vulnerability with Medium severity found Results powered by Checkmarx(c) HOT 2
- [2.8.0, 2.9.0] Aggregation function attempted to calculate value using empty array
- How to reference name of element itself when doing a filter
- Configuration method name does not match function
- Consider implementing RFC 9535 HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonpath.