Query JSON data using Golang (gojsonq)

sample-data.json

Example 1

Query: select * from vendor.items where price > 1200 or id null

example-1.go

Example 2

Query: select name, price from vendor.items where price > 1200 or id null

example-2.go

Example 3

Query: select sum(price) from vendor.items where price > 1200 or id null

example-3.go

Example 4

Query: select price from vendor.items where price > 1200

example-4.go

Example 5

Query: select * from vendor.items order by price

example-5.go

Example 6

Query: select description from .

example-6.go

Example 7

Let's find a deeply nested property and handle error properly:

example-7.go full example

Thank you very much for reading the article

--

--

Software Engineer, Pathao Inc | Open Source Enthusiast | Love to write elegant code | Gopher by passion | https://thedevsaddam.github.io

Love podcasts or audiobooks? Learn on the go with our new app.

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store
Saddam H

Saddam H

Software Engineer, Pathao Inc | Open Source Enthusiast | Love to write elegant code | Gopher by passion | https://thedevsaddam.github.io