jq: how to filter an array of objects based on values in an inner array?

Very close! In your select expression, you have to use a pipe (|) before contains. This filter produces the expected output. . – map(select(.Names[] | contains (“data”))) | .[] .Id The jq Cookbook has an example of the syntax. Filter objects based on the contents of a key E.g., I only want objects whose genre … Read more

Django query negation

You can use exclude() in place of filter(): Entry.objects.exclude(name__contains=”SomeString”) (“give me all entries EXCEPT those with names containing “SomeString”) And when dealing with Q object you can use “~” symbol before Q object to represent negation. For example the following statement means “give me all Entries with names containing “Elephant”, but NOT containing “SomeString”: Entry.objects.filter(Q(name__contains=”Elephant”) … Read more

Including bean definition when a profile is NOT active

You can use a not (!) operator… but you have to use Spring 3.2 M1. The following syntax is now supported <beans profile=”A,!B”> @Profile({“A”, “!B”}) indicating that the element or annotated component should be processed only if profile ‘A’ is active or profile ‘B’ is not active. See change announced here: Spring Framework 3.2 M1 … Read more