I am trying to figure out how I can make a request to the REST API for Parse that can accept a range against the createdAt column. I can issue the following constraint which works but when I try a compound query that tries to do a GT and a LT constraint I get a Bad Request error.
var requestParams = 'where={ "createdAt": { "$gt": { "__type": "Date", "iso": "' + startDate + '" } } } ';
Is this possible with the REST API?
I'm not quite sure in what format you are passing the startDate
. The correct example to do such a thing is as follows.
curl
-X GET
-H "X-Parse-Application-Id: [APP_ID]"
-H "X-Parse-REST-API-Key: [KEY]"
-G --data-urlencode 'where={"createdAt":{"$gte":{ "__type": "Date", "iso": "2014-07-28T07:57:03.900Z" }}}'
https://api.parse.com/1/classes/[YOUR CLASS]
The example below shows how to do this using their Javascript SDK
Javascript query using greaterThan "createdAt"
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With