Skip to content

Invalid key name: $relatedTo with Parse.Query.and #4785

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

Closed
elios264 opened this issue May 24, 2018 · 5 comments
Closed

Invalid key name: $relatedTo with Parse.Query.and #4785

elios264 opened this issue May 24, 2018 · 5 comments

Comments

@elios264
Copy link

elios264 commented May 24, 2018

Issue Description

Parse server is rejecting Parse.Query.and queries in conjution with relations, Parse.Query.or is working correctly.

my usecase is sending a push notification with complex query. therefore I need the Parse.Query.and

usecase

Steps to reproduce

Not working:
relations not working with and query

Working:

or is working

Expected Results

$relatedTo to be supported.

Actual Outcome

an exception.

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.7.4
    • Operating System: windows
    • Hardware: my pc
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): local
  • Database

    • MongoDB version: n/a
    • Storage engine: n/a
    • Hardware: n/a
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): mLab
@flovilmart
Copy link
Contributor

Can you try with:

const installationsQuery = Parse.Query.or(....)
installationsQuery.equalTo('enabled', true);
installationsQuery.exists('user');

Also please provide the server logs when running with VERBOSE=1

@elios264
Copy link
Author

elios264 commented May 24, 2018

Hey @flovilmart,

These are the verbose logs, before trying your approach:

verbose log

Your workaround worked nice so far, I'll keep testing and if I encounter another case parse fails, I'll post it here.

I really appreciate your help, Thanks!

@flovilmart
Copy link
Contributor

Actually the workaround is the original way of doing it. The and operator has been added lately and as you noticed, may be problematic. I’ll fix the issue in a shot future.

@stale
Copy link

stale bot commented Sep 18, 2018

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the wontfix label Sep 18, 2018
@stale stale bot closed this as completed Sep 25, 2018
@LMBernardo
Copy link
Contributor

LMBernardo commented Jun 7, 2021

Can we re-open this issue? It seems to still exist in the current version of parse-server. I'm not sure how to apply the workaround above to my situation - I definitely need AND, not OR.

EDIT: I figured out how to use the above workaround, thanks! I think this is still an issue and should be fixed within the SDK though.

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