-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
is Parse Query Constraints not supported ? #211
Comments
I have similar problems. Doesn't properly work with Android SDK eather: |
Same problem here. Whenever I try to query (via REST API) using a "where" clause, the clause is ignored and instead I get ALL items of that class. |
Ok, this is not supposed to be the case, obviously. Must be some difference from the various test scenarios we have. Will look at it very soon. |
Same problem for me too - when using REST API. It is giving error on line 83 in node_modules/parse-server/node_modules/body-parser/lib/types/json.js file - saying "Unexpected token ....". It is expecting only "{" or "[" there, whereas what is getting passed is "w" or "u" depending upon the query. |
I am having this issue as well. I see there are a number of "issues" regarding this topic but it doesn't seem as though any of them have resolved. I have tried using REST, PHP and JS and its seems like none are adhering to constraints. I apologize that I can't elaborate like others as I used Parse because Im not as advanced in programming to build this out my self. My issue seem like above that no matter what constraints I put on a query I get all objects in that class.
//Returns wrong objectId
Logs blank and the incorrect id
Curl returns list of all objects |
Looks like we don't handle url queries in Classes to be passed as non-body parameters, this is definetly a bug, but for now as a workaround - use JSON body with |
Hi, I'm not sure what the "workaround - use JSON body with method: GET inside of it." means. Can you please show us how to implement the workaround with an example. Perhaps you can show us how to fix the example listed above: curl -X GET \
What would the workaround solution look like for this curl request? Thanks! |
Hi! |
@marcinwalus can you run parse server with VERBOSE=1 set and provide the server logs please? |
What version of parse server are you using? |
Parse Dashboard on my azure server says: "Server version: 2.2.25" |
Parse SDK is: 1.14.2 When I use url grabbed from Dashboard API Console
...it returns correctly only one row {"results":[{"objectId":"29COAmeqPP","name":"Leilab 2","createdAt":"2016-09-05T13:31:54.285Z","updatedAt":"2016-09-21T13:56:29.876Z","city":{"__type":"Pointer","className":"City","objectId":"4OwGCKn8Pg"},"organization":{"__type":"Pointer","className":"Organization","objectId":"CdY1INFkSj"},"showOneMapOnly":true,"visible":true,"order":40,"mainAddress":{"__type":"Pointer","className":"Address","objectId":"zTS2qDuzfY"}}]} |
Ok, that helps :) and the parse-server version that is deployed on azure? |
@flovilmart I'm not 100% sure how to check that, sorry. but looking into "node_modules/parse-server/package.json" in my azure wwwroot folder I see "version": "2.2.25" (same as on my Parse Dashboard), so I think this is a version number. |
that's very odd then, i'll need to dig deeper into it, doesn't seem to occur with curl nor the JS SDK. |
@flovilmart Found it! And I need to say that it was partially my fault, however it should be handled in a better way so I think that this is still a bug. |
Awesome! Glad to know! |
This still doesn't seem to be working in the latest version of Parse Server. I'm using the following code where url is {parseInstance}/classes/reportIt?&where={"createdAt":{"$gt":"2016-12-31T13:30:00Z"}} . No constraints such as gte, gt, lte, lt etc work. The API docs state that this should still work in the new Parse Server. Is a fix planned for this? If not, how would I write a workaround for this? WebHeaderCollection parseHeaders = new WebHeaderCollection();
parseHeaders.Add("X-Parse-Application-Id", applicationId);
parseHeaders.Add("X-Parse-REST-API-Key", applicationKey);
if (!String.IsNullOrEmpty(this.sessionToken))
{
parseHeaders.Add("X-Parse-Session-Token", this.sessionToken);
}
WebRequest webRequest = WebRequest.Create(url);
webRequest.Method = "GET";
webRequest.Headers = parseHeaders;
webRequest.Timeout = ConnectionTimeout;
HttpWebResponse b = (HttpWebResponse)webRequest.GetResponse();
Stream readerStream = b.GetResponseStream();
StreamReader uberReader = new StreamReader(readerStream);
String response = uberReader.ReadToEnd(); |
@hbreumelhof can you provide the server logs when running with VERBOSE=1 ? It's likely your query Params are not properly encoded |
So url is /parse/classes/reportIt?&where=%7b%22createdAt%22%3a%7b%22%24gt%22%3a%222015-12-31T13%3a30%3a00Z%22%7d%7d . This seems to work on Parse but not Parse Server. Version I'm running is 2.3.2. |
@flovilmart any thoughts on what the issue may be? |
Hello ,
I have successfully migrate the database to mongodb and i uploaded parse server to google app engine , i tried to query a class called Category
it worked.However , when i try to do some Constrains like where equal to it didn't work.
the rest api ,shows the same result with or without constrains
in addition i have tried the same thing in android sdks and it didn't work when i put constrains only it works without the constrains.
The text was updated successfully, but these errors were encountered: