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

'--primary' flag no longer works #7

Open
elimisteve opened this issue Mar 15, 2020 · 0 comments
Open

'--primary' flag no longer works #7

elimisteve opened this issue Mar 15, 2020 · 0 comments

Comments

@elimisteve
Copy link

elimisteve commented Mar 15, 2020

At https://www.sanity.io/blog/we-re-open-sourcing-groq-a-query-language-for-json-documents we see the query

$ groq '*[gender == "female" && "physics" in prizes[].category]{firstname, surname}' \
  --url http://api.nobelprize.org/v1/laureate.json \
  --pretty --primary laureates

resulting in

[
    {
      "firstname": "Marie",
      "surname": "Curie, née Sklodowska"
    },
    {
      "firstname": "Maria",
      "surname": "Goeppert Mayer"
    },
    {
      "firstname": "Donna",
      "surname": "Strickland"
    }
  ]

but today it prints null.

It appears that --primary is no longer there, and that that is the culprit. I say that because the query works as expected when we use jq instead of groq's --primary flag:

$ curl -s http://api.nobelprize.org/v1/laureate.json | jq .laureates | groq '*[gender == "female" && "physics" in prizes[].category]{firstname, surname}' --pretty
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

1 participant