parse-community / parse-community/parse-server

`.notEqualsTo` Parse.Query-function weirdness on postgres (for nested objects)

Open
#6,403 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type:bug
Dominant language
JavaScript
Stars
21.4k
Forks
4.8k
Avg merge
7h 45m
Merged PRs (30d)
11

Description

#6177 # Issue Description

.notEqualsTo Parse.Query-function not behaving correctly on postgres (for nested objects)

Steps to reproduce
        var q1 = new Parse.Query("MyClass").equalTo("state.status","open")
        var q2 = new Parse.Query("MyClass").equalTo("state.foo",6)
        await Parse.Query.and(q1,q2).find()

        => [s] // correct

just changing .equalTo to .notEqualTo does not seem to differ at all.

        var q1 = new Parse.Query("MyClass").equalTo("state.status","open")
+++     var q2 = new Parse.Query("MyClass").notEqualTo("state.foo",6)
        await Parse.Query.and(q1,q2).find()

?       => [s]       // should be []

another simplified version:

        await new Parse.Query("MyClass")
        .equalTo("state.status","open")
        .equalTo("state.foo",6).find()

        => [s]      

        await new Parse.Query("MyClass")
        .equalTo("state.status","open")
+++     .notEqualTo("state.foo",6).find()

?       => [s]       // should be []
Environment Setup
  • parse-server version: 3.9.0
  • Operating System: alpine linux 3
  • Localhost or remote server? localhost
  • Postgres version: 11.5
  • Storage engine: Postgres

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reproducing the nested Parse.Query case against parse-server 3.9.0 with PostgreSQL 11.5, comparing equalTo and notEqualTo results. Trace how the query is translated for nested objects, then add a regression test; done means the notEqualTo query returns [] for the reported data while equalTo still returns the matching object.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, postgres
Domain
backend, databases
Issue type
Bug
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Clearly specified
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.