Upgrade to Pro — share decks privately, control downloads, hide ads and more …

Introduction to JSONata

Sponsored · Ship Features Fearlessly Turn features on and off without deploys. Used by thousands of Ruby developers.
Avatar for Ogun Ogun
February 06, 2018

Introduction to JSONata

A short introduction to JSONata using the JSONata Exerciser.

Avatar for Ogun

Ogun

February 06, 2018
Tweet

More Decks by Ogun

Other Decks in Programming

Transcript

  1. • Lightweight JSON query language • Inspired by XPath &

    XQuery • XPath is a query language for selecting nodes from an XML document • XQuery is a query and functional programming language that queries and transforms collections of structured XML data. • Query expressions with minimal syntax and built in operators to manipulate and combine data • Allows user defined functions
  2. • Supported by IBM and used in Node-RED* as the

    default JSON query engine. * Node-RED is a flow-based visual programming environment that one can write code to use APIs, hardware devices, online services and easily wire them together.
  3. Account.Order{ "orders": $.{ "id": OrderID, "products": Product.{ "name": $."Product Name",

    "price": $.Price, "quantity": $.Quantity } }, "totalOrders": $count(OrderID), "totalCost": $sum(Product.(Price*Quantity)) } Sample JSONata Query