nev,
@nev@bananachips.club avatar

Okay, wrestling with jq and I don't know enough about programming to google this effectively.

I have a bunch of different thingies, and some of them have the key 'heldBy: "Person"'. If I ask it to print "Held by (.heldBy)", the thingies that don't have the key just say "Held by null", and that looks gross. How do I tell jq to only print "Held by (.heldBy)" for each thingy if the key exists, and not print anything if it doesn't?

:boost_ok:

phire,
@phire@phire.place avatar

deleted_by_author

  • Loading...
  • nev,
    @nev@bananachips.club avatar

    @phire I cannot quite get my head around it at the moment.

    It's like,, , I do have a select thingy elsewhere, to only print Council items with the status "remaining". But I don't want to only print items that are remaining AND held by people, I only want to print the "held by" field if it exists. Does that make sense?

  • All
  • Subscribed
  • Moderated
  • Favorites
  • random
  • rosin
  • cisconetworking
  • GTA5RPClips
  • osvaldo12
  • khanakhh
  • DreamBathrooms
  • magazineikmin
  • Youngstown
  • everett
  • mdbf
  • slotface
  • InstantRegret
  • kavyap
  • cubers
  • megavids
  • modclub
  • normalnudes
  • Durango
  • thenastyranch
  • ethstaker
  • tacticalgear
  • ngwrru68w68
  • Leos
  • anitta
  • provamag3
  • tester
  • JUstTest
  • lostlight
  • All magazines