Comments (11)
Hi @raj-work
Thanks for the request - we can definitely look at this. Would it be possible to clarify exactly what you need by showing us some sample JSON data, together with the output that you are trying to get. Perhaps you could create a Gist that contains this, and paste a link to it in this issue.
Many thanks.
from jsonata.
hi @andrew-coleman
Thanks for the quick response. I have create a gist with an example. I hope this helps clarify my requirement clearer.
https://gist.github.com/raj-work/22c26fb72e42f0489a352672087ccb06
from jsonata.
Hi @raj-work - in JSONata 1.2 (just released), you can do this with the $map function...
$map(Phone, function($v, $k) {
$v.type = 'office' ? $k
})
See http://try.jsonata.org/B1jy2qugW
from jsonata.
Hi @andrew-coleman - Thanks for your valuable feedback. Unfortunately, we are using JSONata inside a Java application. And currently, Nashorn is not supporting ECMA 6 functions. Is there any suggestion of how to use this inside a Java application? Also, is there any Java implementation which you suggest will work better with JSONata? Thanks.
from jsonata.
@raj-work JSONata 1.2.1 was released today and contains a transpiled version called jsonata-es5.js
for ES5 users, so hopefully you could use that with Nashorn.
from jsonata.
@mattbaileyuk - I notice that the 1.2.1 version has dependency on babel too. I am also looking at using J2V8 engine instead of Nashorn. Are you guys familiar with it? And do you see any drawback in using J2V8 instead of Nashorn?
from jsonata.
@raj-work I haven't had experience of using either, but I think @andrew-coleman has spoken to people who have used JSONata in Java (and/or he's done it himself)
from jsonata.
@mattbaileyuk thanks for your help. @andrew-coleman is it possible for your provide your feedback?
from jsonata.
@raj-work I've never used J2V8 so I can't really add anything here. It looks interesting though, and if you get chance to try it with JSONata, I'd be very keen to hear about your experiences.
from jsonata.
@andrew-coleman - Let me try and update you guys if that works. Thanks for all your help.
from jsonata.
Closing this issue since the original requirement has been met.
from jsonata.
Related Issues (20)
- Reserved Tokens Documentation
- ($.some_non_existent_key != 'anything') evaluates to false HOT 3
- $string(number) capped at precision-15
- Error handling and asynchronous behavior in evaluate function
- Rounding number without "Round half to even"
- There isn't a uuid() function for JSONata HOT 2
- Hard spaces in documentation not rendered correctly
- Security contact for JSONata HOT 4
- default query on try.jsonata.org HOT 1
- is 2.0.4 a fake release? HOT 4
- Multi-level JSON processing: Unwrapping Objects
- How to work with parent object and transform values
- Stronger `registerFunction` TS types by inferring types from signature, and a road to a language service (PR coming!)
- Feature: Jsonata json type inference HOT 5
- JSONata leaks internal references in expression when using lambdas
- JSONAta expression can be created that ends up in mutation of original input object
- `__evaluate_entry` and `__evaluate_exit` can be overridden inside expression
- $sort fails for >6000-element arrays HOT 1
- Why is jsonata async/await? HOT 2
- Unexpected array access behaviour HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from jsonata.