thedevsaddam / gojsonq

A simple Go package to Query over JSON/YAML/XML/CSV Data
https://github.com/thedevsaddam/gojsonq/wiki
MIT License
2.17k stars 140 forks source link

Filter based on value contained in an array #106

Open rchaganti opened 11 months ago

rchaganti commented 11 months ago

I may be missing something here, but consider this example.

JSON:

[
 {
  "id": 1,
  "name": "John",
  "projects": ["Go","Python","AI"]
 },
{
  "id": 2,
  "name": "Jerry",
  "projects": ["Go","AI"]
 },
{
  "id": 4,
  "name": "Joe",
  "projects": ["AI"]
 }
]

If I have a JSON document like this and I want to query for all objects containing AI in the projects slice, how do I do that? I tried WhereIn(), but that does not seem to help!