Relationship pluck


#1

Hi, I’ve got a user relationship named properties that return multiple records per user, I want to basically return for a specific user an array with the properties ids. What I currently have is user.properties().fetch() and it’s returning everything. How can I return only the ids?


#2

Can you try?

await user.properties().ids()

#3

It returns me all the properties ids on the table, it should be only two


#4

Can u share the query being executed by setting debug: true inside the config/database.js file?


#5

Hello, I can confirm that user.properties().ids() returning all ids from the pivot table.

Example repo: https://github.com/ammezie/tweetr-api

@virk


#6

Hey @BatuhanK! :wave:

It’s a confirmed bug and we already have a regression test on same.