-
-
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
doesNotMatchKeyInQuery and equalTo doesn't work in single query if used for same column #3678
Comments
Failing test
|
can you open a PR with the failing test? This will help design the fix. Do you think you can take the fix on? |
It seems that the test passed with postgresql database. |
Yes, that helps pin-pointing the issue in the adapter and not in an upper layer |
@flovilmart any help on start hunting this issue by myself? Where should i start? :) Haven't found a place where it sets $dontSelect to a query; |
Also, as we have failing test (not merged yet) maybe we should add BUG label to this issue? |
Yep most likely. The issue may be isolated in that method: transformWhere which is responsible for transforming the REST query format to the mongo query format. As you've shown, the query seems to be properly issued on postgres which makes me think it has to be in there. |
It seems the problem might be in RestQuery, not in transformWhere. As transformWhere already receives wrong payload. RestQuery is actually executing subquery, and adding results to $nin for doesNotMatchKeyInQuery() (pretty much replacing this call with notContainedIn()); Problem is having $eq on same column is handled in wrong way; If i change
where with equalTo() it's
|
do you have the original payload? if it's probably just a matter of making sure we have:
|
Is this the same issue ? http://stackoverflow.com/questions/43163319/simple-nested-query-parse-not-working |
Not sure it's the same issue, this one is when mixing match and equality in the same query. One constraint gets overrides |
Hmm looked again. It looks like a comparison between a string(objectId) and a pointer. (Deal) Out of curiosity I have no clue how such a query would be solved. There is no way you could do a dot notation inside a LinQ statement right |
So there is also a bug in the JS SDK, is should replace 'key': object with |
Issue Description
Trying to make query by using doesNotMatchKeyInQuery() and equalTo() on same column fails to produce correct output;
Steps to reproduce
Expected Results
Return post of user provided in equalTo() only if requester (req.user) is not blocked by post author;
Actual Outcome
equalTo() takes bigger priority and post is returned even if post author has req.user blocked;
Note: not having equalTo() seems to work correctly, blocked users don't see the content;
Environment Setup
Server
Database
Logs/Trace
Include all relevant logs. You can turn on additional logging by configuring VERBOSE=1 in your environment.
The text was updated successfully, but these errors were encountered: