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

add @ operator to blues jsonata #12

Open
tbal999 opened this issue Jun 29, 2022 · 1 comment
Open

add @ operator to blues jsonata #12

tbal999 opened this issue Jun 29, 2022 · 1 comment

Comments

@tbal999
Copy link

tbal999 commented Jun 29, 2022

Firstly - excellent work porting jsonata to Golang. Impressive. I have a request:

In original JSONATA they have # and @ operators which enable JOIN like operations on data (a simplification on top of usage of map and filter) i.e

$$.new.additionalfeatures @ $T1.$$.old.items @ $T2[$T1.id = $T2.id].{
    "id": $T1.id,
    "color": $T1.colour,
    "name": $T2.name
}

and currently you'd need to do something like

$$.old.items.{
    "id": $.id,
    "name": $.name,
    "color": ($filter($$.new.additionalfeatures, function($i){$i.id = $.id})).colour
}

It would be useful to have at least the @ operator added to the Go port of jsonata.

I appreciate this would be a fiddly bit of work - so it's a 'nice to have'.

@tbal999
Copy link
Author

tbal999 commented Jun 29, 2022

In the original jsonata - here is the PR that introduced @ and # operators to the codebase: https://github.com/jsonata-js/jsonata/pull/371/files#diff-54c345dc104dc19440f9c2482b7883df820e8b9b699fdd8fa07e2773e7197a29

tbal999 pushed a commit to tbal999/jsonata-go that referenced this issue May 14, 2023
* Add a failing test for time parsing

* Remove idea

* test

* Revert old error change

* Fix

* Add another test

* Fix

* Add fix incase there were spaces

* Fix a few more edge cases

* More edge cases

* Finaly fixes

* Remove milliseconds when a date time comes in

* Remove test from the root
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