Skip to content
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

doesNotMatchKey not working #845

Closed
dasoga opened this issue Mar 8, 2016 · 5 comments
Closed

doesNotMatchKey not working #845

dasoga opened this issue Mar 8, 2016 · 5 comments

Comments

@dasoga
Copy link

dasoga commented Mar 8, 2016

Hi!

I'm trying to do this query on my own hosted Parse server but I get error con shell:
Code:
- (PFQuery *)queryForTable { PFQuery *bann = [PFQuery queryWithClassName:@"Banned"]; PFQuery *query = [PFQuery queryWithClassName:self.parseClassName]; query.cachePolicy = kPFCachePolicyCacheThenNetwork; query.cachePolicy = kPFCachePolicyNetworkElseCache; [query whereKey:@"qUser" doesNotMatchKey:@"bannedUser" inQuery:bann]; [query orderByAscending:@"createAt"]; return query; }

Get on shell:
*[Error]: improper usage of $dontSelect (Code: 102, Version: 1.12.0) *

Thanks For help.

@nlutsenko
Copy link
Contributor

Hey @dasoga, sounds very strange, as this should work...
Let's debug this together, here are few questions that would help:

  • Are you using parse.com or self-hosted Parse Server?
  • What does your object schema look like for both Banned and the objects you are querying for (can't see the class name).
  • Could you instrument your app with Network Debug Tool from this guide. The most important piece is how the query is being sent to the server...
  • Does this reproduce if you are issuing a cURL request with the same data?

Confident we can uncover the problem together...

@nlutsenko nlutsenko self-assigned this Mar 8, 2016
@parse-github-bot
Copy link

Thank you for your feedback. We prioritize issues that have clear and concise repro steps. Please see our Bug Reporting Guidelines about what information should be added to this issue.

Please try the latest SDK. Our release notes have details about what issues were fixed in each release.

In addition, you might find the following resources helpful:

@dasoga
Copy link
Author

dasoga commented Mar 9, 2016

Hi @nlutsenko

  • Are you using parse.com or self-hosted Parse Server?

self-hosted Parse Server

  • What does your object schema look like for both Banned and the objects you are querying for (can't see the class name).
    I have the class "Question" (questions uploaded for users) and class "Banned" (for users banned). And I want to do a query for question without user banned.
  • Could you instrument your app with Network Debug Tool from this guide. The most important piece is how the query is being sent to the server...

Request Body : {"where":{"qUser":{"$dontSelect":{"query":{"className":"Banned"},"key":"bannedUser"}}},"order":"createAt","_method":"GET","limit":"10"} 2016-03-08 18:07:16.600 alertatrasero[14595:6171749] [Error]: improper usage of $dontSelect (Code: 102, Version: 1.12.0) 2016-03-08 18:07:16.600 alertatrasero[14595:6171750] URL : http://184.171.252.178:1337/parse/classes/Question 2016-03-08 18:07:16.601 alertatrasero[14595:6171750] Status Code : 400 2016-03-08 18:07:16.601 alertatrasero[14595:6171750] Headers : { "Access-Control-Allow-Headers" = "X-Parse-REST-API-Key, X-Parse-Javascript-Key, X-Parse-Application-Id, X-Parse-Client-Version, X-Parse-Session-Token, X-Requested-With, X-Parse-Revocable-Session, Content-Type"; "Access-Control-Allow-Methods" = "GET,PUT,POST,DELETE,OPTIONS"; "Access-Control-Allow-Origin" = "*"; Connection = "keep-alive"; "Content-Length" = 52; "Content-Type" = "application/json"; Date = "Wed, 09 Mar 2016 00:07:11 GMT"; Etag = "\"1510158381\""; "X-Powered-By" = Express; }

  • Does this reproduce if you are issuing a cURL request with the same data?

When I do a CURL to get the objects of Banned class everything is correct, same to the Question class. I don't know how can I do CURL with "doesNotMatchKey" parameter.

Thanks for response!

@nlutsenko
Copy link
Contributor

I think I've found the issue - this is the relevant piece of code that gets triggered.

I am going to double check whether removing a !query.where is going to impact anything, but I think that's the fix... Overall, as a workaround - add any condition to your banned query and it should start working.

@dasoga
Copy link
Author

dasoga commented Mar 9, 2016

Excellent work @nlutsenko I added any condition to Banned query and it works!
For this moment I'll keep this query this way
Thanks a lot for your help.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants