Skip to content

Adding DOM support for json path with wildcard#2346

Merged
lemire merged 62 commits intosimdjson:masterfrom
dabigjoe6:asteriks
Aug 14, 2025
Merged

Adding DOM support for json path with wildcard#2346
lemire merged 62 commits intosimdjson:masterfrom
dabigjoe6:asteriks

Conversation

@dabigjoe6
Copy link
Contributor

@dabigjoe6 dabigjoe6 commented Mar 11, 2025

Implementation for #2306

Introduces wildcard support (*) for JSONPath queries, allowing bulk retrieval of array/object values through patterns like $[*] or $.key.*.

  • Added at_path_with_wildcard() to array, object, and element to avoid breaking changes as it uses std::vector<element> return type which differs from at_path() return type (open to suggestions if there's a way to make this work with existing at_path function)
  • A get_values() function in array and object to return all child elements as std::vector<element>
  • Added test case validating:
    • Top-level wildcards ($.*, $[*])
    • Nested wildcards ($.address.*, $.*.streetAddress)

Hi maintainers - this is my first C++ contribution, and I'm eager to learn. Please let me know if any patterns could be optimized or simplified 🙏

@lemire
Copy link
Member

lemire commented Mar 13, 2025

@dabigjoe6 This is potentially useful work.

@dabigjoe6
Copy link
Contributor Author

@dabigjoe6 This is potentially useful work.

Thanks for the feedback. I actually moved this to my fork to polish it up a bit more. I'll sync here and reach out here when it's ready for a proper look

@dabigjoe6 dabigjoe6 marked this pull request as draft March 23, 2025 23:06
@dabigjoe6 dabigjoe6 marked this pull request as ready for review July 24, 2025 19:56
@dabigjoe6 dabigjoe6 requested a review from anonrig July 24, 2025 19:56
@lemire
Copy link
Member

lemire commented Aug 5, 2025

@dabigjoe6 Please consider the following PR on top of your PR: dabigjoe6#4

Copy link
Member

@lemire lemire left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@dabigjoe6 dabigjoe6 requested a review from lemire August 8, 2025 17:50
@lemire
Copy link
Member

lemire commented Aug 8, 2025

Running tests.

@lemire lemire merged commit fb9a689 into simdjson:master Aug 14, 2025
74 of 75 checks passed
@lemire
Copy link
Member

lemire commented Aug 14, 2025

Merged. Great work.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants