Getting only the INTof a record id from a get all records query

Answered

I am unable to get a only the INT from a simple get all records query.

I am getting the company id from the logged in user and store it in buyer_id.
Using the buyer_id, I filter my second query certificates using only the company_id INT.

How can I get only the number the INT and not the object with the number? The closest I get is [2] or [{id: 2}] and not 2

Happy to hear other ways of doing it.

Essentially I simply want to display certificates that belong to a logged in user.
My shema:

table: 'users'

table: 'companies' links to > user_id

table: 'certificates' links to > 'companies'

Many thanks.



14 replies