Parse API for Php

I am currently working on one application that uses the parse API in php. Scenario: I have 3 tables named User, Kidsand JournalEntry. Userhas a lot Kidsand Kidshas a lot Journal Entry. Thus, a table with the same Kidshas User Pointer, and JounralEntryalso has 2 pointers with the name KidsIDand UserID. When I try to get data from a table JournalEntry, it takes too much time due to the two queries that I run. The first query is to retrieve data from the table Kids, and the second is for the table JournalEntrybased on the first query objectid.

Is there any way in the Parse API, we can immediately run one of the following requests:

SELECT * FROM JounralEntry
WHERE Kids.objectId = JounralEntry.kidsID AND User.objectId = JounralEntry.UserID ?
+4
source share
1 answer

You can use relational queries to achieve this.

curl -X GET \
  -H "X-Parse-Application-Id: " \
  -H "X-Parse-REST-API-Key: " \
  -G \
  --data-urlencode 'where={"KidsId":{"$inQuery":{"where":{REPLACE_WITH_YOUR_QUERY_HERE},"className":"Kids"}}}' \
  https://api.parse.com/1/classes/JounralEntry

Please correct any wrong field in the request.

+1
source

All Articles