DEV Community

loading...

SDC Day 6

Timothy Nguyen
Software Engineering Graduate from Hack Reactor
・1 min read

It's time to start optimizing my queries! The first thing I wanted to do was reduce my products endpoint to use a single query with the features in an array. I was able to store all the features into individual objects using json_build_object. I then used array_agg to concatenate all these objects into the same array and attach the array to the product. I then started doing the same thing to my styles endpoint but am having difficulties.

Discussion (0)

Forem Open with the Forem app