You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello! I was looking for an easy way to query and filter JSON data and I discovered your library a couple days ago. I really like the expression syntax and after playing around with it on groq.dev, I was really encouraged that it was the answer to all my prayers :) I installed groq-js in my project and created a test using the example code here (https://www.npmjs.com/package/groq-js) replacing the data with my own. (Slightly transformed data from Overpass/OSM.)
Using the same dataset and expression, I found that the results in my local test were not the same as what I got on GROQ Arcade. The local test results were missing an attibute. (See attached code with data: groqTest.zip)
On GROQ Arcade, the result was (as expected): [ [ { "name": "111A Avenue", "total": 3 } ], [ { "name": "153B Street", "total": 3 } ], [ { "name": "109 Avenue", "total": 3 } ] ]
But the local test produced: [ { total: 3 }, { total: 3 }, { total: 3 } ]
What happened to the "name" attribute? It also seems to have removed the inner, single-element arrays. Am I doing something wrong? Is GROQ Arcade using a different version?
Thanks!
The text was updated successfully, but these errors were encountered:
Yes, groq-js is being actively developed. We haven't updated GROQ Arcade recently as we're still figuring out how GROQ should behave in all edge cases. This is one of those edge cases which isn't fully documented yet so I can't really say right away whether your query is incorrect or if the implementation is incorrect. We're working on it though!
Ok, thanks for the update. Having no idea about the internals of groq-js or the particular issues of the edge cases, I can only naively suggest it might be nice to have an option to parameterize the behavior. (For my use case, I would want to keep the inner arrays and keep the other attribute :) .)
Anyway, I was really impressed that I was able to make my query in such an intuitive manner. I'm really hoping I can use this for my project. Cheers!
Hello! I was looking for an easy way to query and filter JSON data and I discovered your library a couple days ago. I really like the expression syntax and after playing around with it on groq.dev, I was really encouraged that it was the answer to all my prayers :) I installed groq-js in my project and created a test using the example code here (https://www.npmjs.com/package/groq-js) replacing the data with my own. (Slightly transformed data from Overpass/OSM.)
Using the same dataset and expression, I found that the results in my local test were not the same as what I got on GROQ Arcade. The local test results were missing an attibute. (See attached code with data: groqTest.zip)
On GROQ Arcade, the result was (as expected):
[ [ { "name": "111A Avenue", "total": 3 } ], [ { "name": "153B Street", "total": 3 } ], [ { "name": "109 Avenue", "total": 3 } ] ]
But the local test produced:
[ { total: 3 }, { total: 3 }, { total: 3 } ]
What happened to the "name" attribute? It also seems to have removed the inner, single-element arrays. Am I doing something wrong? Is GROQ Arcade using a different version?
Thanks!
The text was updated successfully, but these errors were encountered: