Nesting results objects

50 views
Skip to first unread message

P. E.

unread,
Jun 8, 2021, 4:11:44 PM6/8/21
to lovefield-users
Hello,

I wrote select query like below:

const queriedScheduleEntries = await dbInstance
  .select(
      scheduleEntryTable.id.as('id'),
      collaboratorTable.id,
      collaboratorTable.isActive,
      collaboratorTable.employeeId,
      collaboratorTable.projectId,
      employeeTable.name,
      projectTable.name,
   )
.from(scheduleEntryTable, collaboratorTable)
.innerJoin(collaboratorTable, collaboratorTable.id.eq(scheduleEntryTable.collaboratorId))
.innerJoin(employeeTable, employeeTable.id.eq(collaboratorTable.employeeId))
.innerJoin(projectTable, projectTable.id.eq(collaboratorTable.projectId))
.exec();

P. E.

unread,
Jun 8, 2021, 4:14:25 PM6/8/21
to lovefield-users
Screenshot of result is attached to this message

My question is now to nest a `project` and an `employee` inside a `collaborator` object?

Thanks
ss.png
Reply all
Reply to author
Forward
0 new messages