0

I want to sort based on the nested property of Loopback 4. I can't find any direct way in Loopback 4 for this.

http://localhost:3000/pictures?filter={"where":{"and":[{"isParent":1}]},"include":[{"relation":"comment"},{"relation":"profile"}],"offset":0,"order":["profile.fullName ASC"],"limit":5}

This gives an error coz profile.fullName is a nested property from relation.

So to find a solution for this, I was thinking what if I can get the Postgres query created by Loopback 4 and manipulate the query, and then hit the database. Can this be done?

Any help, highly appreciated!

user2869736
  • 133
  • 9

1 Answers1

0

You can turn on the debugging flag for database connection

DEBUG=loopback:connector:* npm run start
ghiden
  • 2,083
  • 1
  • 17
  • 20