Skip to content

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

Closed

Description

@dstarke

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)

Activity

  1. ananfang commented on Apr 13, 2017

    @ananfang
    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?

  2. flovilmart commented on Apr 13, 2017

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

  3. ananfang commented on Apr 13, 2017

    @ananfang
    Contributor

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

  4. flovilmart commented on May 6, 2017

    @flovilmart
    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 :)

  5. ananfang commented on May 8, 2017

    @ananfang
    Contributor

    @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 :)

  6. flovilmart commented on May 8, 2017

    @flovilmart
    Contributor

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

  7. stale commented on Sep 18, 2018

    @stale

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions