Hacker News new | ask | show | jobs
by monkeydata 2423 days ago
to be productive, you have to minimize the need to rtfm, but you should also be cognizant of any new implementations -- a refresher may sometimes provide a better way.

I recently stumbled on the postgres method jsonb_insert(jsonb,path,value) which is much more elegant than jsonb_set(jsonb,path,jsonb||value) when you just want to add a thing to some json array inside an object.

I hadn't really looked at the docs much since 9.x, I deal with jsonb everyday, so I had what I needed memorized. But despite keeping my installs updated, I had been doing it the hard way for way too long.