Page 1 of 1

Are Parse queries supported?

Posted: Fri Feb 17, 2012 3:10 am
by kevinmp79

I was wondering if it's possible to use Parse queries in tiggzi? I had a look at your tutorial but they don't address the issue of querying data from Parse.

The problem is that the Parse query has to be in the form of a JSON object and not the url variable format which REST mapping supports.

Additionally, would they be able to support the Parse geopoint queries?


Are Parse queries supported?

Posted: Fri Feb 17, 2012 4:32 am
by maxkatz

Sure, it's possible. I looked here: https://parse.com/docs/rest#queries. They are all GET requests and the data is URL encoded (default for GET, --data-urlencoded): ..?param1=value1&param2=value2.


Are Parse queries supported?

Posted: Fri Feb 17, 2012 8:38 am
by kevinmp79

Hi Max,

Unfortunately Parse queries are encoded in one JSON object and not via separate URL parameters so if I were to query an object for a name=john and age=12, it would not be like this http://api.parse.com/1/classes/test/?.... If it were done like that I would be able to use the REST mapping to create the query.

Parse requires that their query need to be encoded into a JSON object so based on the example above the query would be http://api.parse.com/1/classes/test/?..." : "john" , "age" : "12";}. From what I can see that's not supported in the URL mapping.

Can you confirm if Parse queries can be processed? I tried non-queries and they work but I can't get queries working.


Are Parse queries supported?

Posted: Fri Feb 17, 2012 6:47 pm
by maxkatz

That's true, but the JSON part is just how Parse expects the value, it's their format that you need to follow. Then the value is URL encoded. From Parse docs:

[quote:]
The value of the where parameter should be encoded JSON. Thus, if you look at the actual URL requested, it would be JSON-encoded, then URL-encoded.
[/quote]

Here is what I did and it works:
Image

code
where {"text": {"$regex": "D"}}
/code

to find all string values that start with letter D.


Are Parse queries supported?

Posted: Sat Feb 18, 2012 2:10 am
by kevinmp79

Thanks Max, I guess my question should be: can this be done using the standard tiggzi tools (e.g. the REST mapping from the REST service) or will I need to write custom JS to handle this?

If this is possible to do using the standard REST service interface and mapping, would you please consider adding this into the Parse tutorial currently on the site?

The tutorial is great but it only covers listing, adding and deleting info and doesn't cover querying which would be an integral part of any application.


Are Parse queries supported?

Posted: Sun Feb 19, 2012 12:53 am
by maxkatz

Sure, I'll add a tutorial on using queries.

We can look at adding such feature but it should be pretty easy to create such format even right now. The JSON should be pretty straight forward, no arrays or objects.


Are Parse queries supported?

Posted: Tue Apr 17, 2012 4:24 pm
by anilsojitra

please can you advise whether the you have updated the tutorial with using queries on parse.com


Are Parse queries supported?

Posted: Tue Apr 17, 2012 5:29 pm
by maxkatz

Not yet.


Are Parse queries supported?

Posted: Tue Apr 24, 2012 8:27 pm
by maxkatz

OK, finally (sorry for the long delay): http://help.gotiggr.com/documentation...