Quantcast
Channel: Active questions tagged jq - Stack Overflow
Viewing all articles
Browse latest Browse all 527

jq select elements with array not containing string

$
0
0

Now, this is somewhat similar to jq: select only an array which contains element A but not element B but it somehow doesn't work for me (which is likely my fault)... ;-)

So here's what we have:

[ {"employeeType": "student","cn": "dc8aff1","uid": "dc8aff1","ou": ["4210910","4210910 #Abg","4210910 Abgang","4240115","4240115 5","4240115 5\/5"        ]    },    {"employeeType": "student","cn": "160f656","uid": "160f656","ou": ["4210910","4210910 3","4210910 3a"        ] } ]

I'd like to select all elements where ou does not contain a specific string, say "4210910 3a" or - which would be even better - where ou does not contain any member of a given list of strings.


Viewing all articles
Browse latest Browse all 527

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>