I am developing a Task Management app in flutter and I am using Parse SDK for the backend.
How to fetch data of pointer/ relation columns in a query?
My setup:
I have 4 Classes
User: this is parse user with the username, email, and password
Categories: columns--> cat_name ( name of this category)
Task: below are the columns- task_name ( name of this task ) and task_cat (this is a pointer to Category class)
Activities: Below are the columns: userID ( a pointer to User class ) taskId: ( a pointer to Task Class ) startTime ( DateTime ) endTime ( DateTime) activityNotes ( String ) activityDuration( Number)
I am running the following code:
await ParseObject('Activities').getAll();
And I am getting the following response:
[{"className":"Activities","objectId":"F7TviWDd1H","createdAt":"2021-02-17T07:21:33.723Z","updatedAt":"2021-02-18T08:59:51.649Z","startTime":{"__type":"Date","iso":"2021-02-17T06:21:00.000Z"},"endTime":{"__type":"Date","iso":"2021-02-17T07:21:00.000Z"},"userID":{"__type":"Pointer","className":"_User","objectId":"1tHoCAv1QW"},"taskID":{"__type":"Pointer","className":"Tasks","objectId":"MFC2oMP2wL"},"activityNotes":"This is a Test Activity","activityDuration":11234000,"ACL":{"":{"read":true}}}, {"className":"Activities","objectId":"5dNxryEGdi","createdAt":"2021-02-17T08:50:58.480Z","updatedAt":"2021-02-18T08:59:58.736Z","startTime":{"__type":"Date","iso":"2021-02-17T04:50:00.000Z"},"endTime":{"__type":"Date","iso":"2021-02-17T06:50:00.000Z"},"userID":{"__type":"Pointer","className":"_User","objectId":"1tHoCAv1QW"},"taskID":{"__type":"Pointer","className":"Tasks","objectId":"rghVxYA6BX"},"activityNotes":"This is another test activity","activityDuration":33456000,"ACL":{"":{"read":true}}} ]
My query:
How can I get the username, task_name, and cat_name associated with an activity in a single query??