Skip to content

LiveQuery does not match subobjects in query specified with dot notation #3321

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
4 tasks done
dstarke opened this issue Jan 4, 2017 · 7 comments
Closed
4 tasks done

Comments

@dstarke
Copy link
Contributor

dstarke commented Jan 4, 2017

Make sure these boxes are checked before submitting your issue -- thanks for reporting issues back to Parse Server!

--

Issue Description

Parse Server allows you to specify queries on nested subobjects using dot notation. For example, the query specified using query.equalTo("status.x", "someValue"); will match objects where there is a status attribute whose value is an object with the key x and the value "someValue".

Although this works correctly for queries issued through the REST API, the LiveQuery system does not correctly match objects based on this type of constraint. As a result, queries that use this type of key specification can return objects that the LiveQuery system will not return notifications for.

Steps to reproduce

  1. Create an object with a nested subobject as its value
  2. Construct a query that selects objects based on a value in the subobject using dot notation.
  3. Issue the query, confirm that the object is returned by the query
  4. Subscribe to the query to get LiveQuery updates
  5. Update the object you created in step 1.
  6. Note that no LiveQuery updates for this object are received by the client.

Expected Results

Client should receive LiveQuery updates

Actual Outcome

Client does not receive LiveQuery updates

Environment Setup

  • Server

    • parse-server version (Be specific! Don't say 'latest'.) : 2.3.1
    • Operating System: macOS Sierra 10.12.2
    • Hardware: MacBook Pro (15-inch, Late 2011)
    • Localhost or remote server? (AWS, Heroku, Azure, Digital Ocean, etc): Localhost (also observed running on Azure)
  • Database

    • MongoDB version: 3.2.11
    • Storage engine: MMAPv1
    • Hardware: unknown
    • Localhost or remote server? (AWS, mLab, ObjectRocket, Digital Ocean, etc): mLab

Logs/Trace

(no relevant logs)

@ananfang
Copy link
Contributor

Hi @dstarke
Thanks for your effort that enable dot notation query of Live Query.

There is something weird that you mention that query.equalTo("status.x", "someValue"); can work. But I tried using this kind of query in iOS, it failed.

Is it possible that query with dot notation?

@flovilmart
Copy link
Contributor

It is supported in Parse-server, querying with dot notations.

As for the support for more complex queries, the main barrier is that the current implementation is synchronous and doesn't touch the DB for performance reasons. We'd have to make the query matching async first, and then add the support for such query constraints, this time, with DB access.

@ananfang
Copy link
Contributor

Thanks for your reply @flovilmart.
Is there any schedule you plan to implement querying with dot notations?

@flovilmart
Copy link
Contributor

@ananfang for now, no schedule i'm afraid, but if you feel you want to tackle the issue, i could help you get going :)

@ananfang
Copy link
Contributor

ananfang commented May 8, 2017

@flovilmart I'am afraid that I can't handle these issue currently, I am zero experience on Node.js developement. I'll try to start studyin on Node.js, if I am ready, I'll tell you later :)

@flovilmart
Copy link
Contributor

It's ok, always a good opportunity to learn.

@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.

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