Git Product home page Git Product logo

Comments (11)

andrew-coleman avatar andrew-coleman commented on August 15, 2024

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.

raj-work avatar raj-work commented on August 15, 2024

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.

andrew-coleman avatar andrew-coleman commented on August 15, 2024

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.

raj-work avatar raj-work commented on August 15, 2024

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.

mattbaileyuk avatar mattbaileyuk commented on August 15, 2024

@raj-work JSONata 1.2.1 was released today and contains a transpiled version called jsonata-es5.jsfor ES5 users, so hopefully you could use that with Nashorn.

from jsonata.

raj-work avatar raj-work commented on August 15, 2024

@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.

mattbaileyuk avatar mattbaileyuk commented on August 15, 2024

@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.

raj-work avatar raj-work commented on August 15, 2024

@mattbaileyuk thanks for your help. @andrew-coleman is it possible for your provide your feedback?

from jsonata.

andrew-coleman avatar andrew-coleman commented on August 15, 2024

@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.

raj-work avatar raj-work commented on August 15, 2024

@andrew-coleman - Let me try and update you guys if that works. Thanks for all your help.

from jsonata.

andrew-coleman avatar andrew-coleman commented on August 15, 2024

Closing this issue since the original requirement has been met.

from jsonata.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.