Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wildcards in query argument to fparse() #95

Open
gacolitti opened this issue Sep 15, 2024 · 1 comment
Open

Wildcards in query argument to fparse() #95

gacolitti opened this issue Sep 15, 2024 · 1 comment

Comments

@gacolitti
Copy link

Is it possible to add the ability to use wildcards in the query arg to fparse() and fload()?

For example:

json <- '{
  "entries": [
    { "entryKey": "12345" },
    { "entryKey": "67890" },
    { "entryKey": "54321" }
  ]
}'

# Extract the entryKey from the first entry
RcppSimdJson::fparse(json, query = "/entries/0/entryKey")

# Extract the entryKey from the second entry
RcppSimdJson::fparse(json, query = "/entries/1/entryKey")

# Extract the entryKey from the third entry
RcppSimdJson::fparse(json, query = "/entries/2/entryKey")

# Extract all entry keys using wildcard (doesn't work)
# RcppSimdJson::fparse(json, query = "/entries/*/entryKey")
@eddelbuettel
Copy link
Owner

The 'globbing', i.e. the expansion of the wild card has to happen somewhere, and I do not think the simdjson library is set up for it. @lemire can correct me here but I don't think I am overlooking anything.

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

No branches or pull requests

2 participants