How do I get a list of objects within a relation in Parse Server?

Asked

Viewed 14 times

0

Good afternoon!

I use Parse Server on the Back4app platform and need to get the list of all users who are within a certain Role. There is the Role class, in which it stores the user’s permission levels (coordinator, collaborator, manager...). In each object of this class, there is a relation containing all the users linked to it. What I need is to list which users are within the 'coordinator' role'.

I’m trying to get this list but I can’t find in the parse documentation how to do.

const queryRole = new Parse.Query(Parse.Role)
.equalTo('name', 'Coordinator')
.include('users')
const resultRole = await queryRole.first()
const result = resultRole.get('users')

But the answer is just an object I can’t extract the information from. I’ve tried using one include('users') as in a Pointer but also does not work

No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.