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

Attempting transform didn't work for Account.Order ... #94

Closed
wnm3 opened this issue Nov 10, 2017 · 6 comments
Closed

Attempting transform didn't work for Account.Order ... #94

wnm3 opened this issue Nov 10, 2017 · 6 comments
Labels

Comments

@wnm3
Copy link

wnm3 commented Nov 10, 2017

Even after setting the exerciser to use J:use 1.4

This fails:
Account.Order~>|Product.Description|{'Weight':(Weight * 16)}|

However this works:
Account~>|Order.Product.Description|{'Weight':(Weight * 16)}|

From the closed issue #70 I was hoping what was shown in the example image below was supported in the new 1.4 release:

image

Maybe the Exerciser use of the 1.4 branch didn't pick up the released 1.4 code yet?

@shrickus
Copy link

I believe the way to switch the exerciser to the new branch is the type "J:branch 1.4" in the input window. When I do that, I see the alternate version shown as ** 1.4 ** underneath the word JSONata in the upper right window.

That being said, I'd much rather see a version pulldown selection list in the title bar of the exerciser page. Switching versions by typing some cryptic string in the input window is a bit of a kludge, and requires the user to know what versions are available. Also, before typing in the branch to use, there is no feedback on the page to show what version is currently running by default. Both of these issues could be handled with a simple select list, I believe.

@andrew-coleman
Copy link
Member

Hmm. As a workaround, use this:
Account.Order.($ ~> |Product.Description|{'Weight':(Weight * 16)}|)

I need to fixup the generated function to work with an array of objects. I'll do that in a maintenance release next week.

Thanks for reporting!

@wnm3
Copy link
Author

wnm3 commented Nov 10, 2017

Thanks @shrickus -- I had done the J:branch 1.4 but forgot that syntax when typing the issue.
Thanks @andrew-coleman for the workaround.

@andrew-coleman
Copy link
Member

@shrickus you're right, it is a kludge; it was a quick hack I'd put in for myself to switch to a local dev branch. Originally, the exerciser was a tool that I knocked up to help me develop and test the language. But it took on a life of its own. It's now on github, so any improvements anyone wishes to make, please raise an issue & send a PR :)
Thanks!

@mattbaileyuk
Copy link
Member

Should also mention that as part of the version switch changes the exerciser will now pick up the latest version from npm as the default.

@mattbaileyuk
Copy link
Member

This has now been resolved in the newly published 1.4.1 which the exerciser has automatically picked up: http://try.jsonata.org/SyAfdqwkM

If you have any further problems with this, please reopen the issue.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants