Hi, a newcomer here! πŸ™‚ I'm currently developing ...
# help
c
Hi, a newcomer here! πŸ™‚ I'm currently developing a project where I need to query data with multiple joins between tables (ref: example below). Is there a way to "flatmap" or remove keys when joining tables in the query itself or do I have to transform it on client side? Been reading through the supabase docs and on resource embedding on postgrest.org - cannot seem to find a solution.
Copy code
// Query
trip(
  id,
  timestamp,
  distance,
  owner:profiles(
    first_name,
    last_name
  )
)

// Current result 
{
  id: "",
  timestamp: "",
  distance: 0.0,
  owner: {
    first_name: "",
    last_name: ""
  }
}

//  Wanted result
{
  id: "",
  timestamp: "",
  distance: 0.0,
  first_name: "",
  last_name: ""
}
n
Hello @Certinax! This thread has been automatically created from your message in #843999948717555735 a ``few seconds ago``. Pinging @User so that they see this as well! Want to unsubscribe from this thread? Right-click the thread in Discord (or use the ... menu) and select Leave Thread to unsubscribe from future updates. Want to change the title? Use the
/title
command! We have solved your problem? Click the button below to archive it.
s
Yeah, to flatten the result you have to do it client side for now.
n
Certinax (2022-04-06)
c
Alright, thank you so much😊