-
-
Notifications
You must be signed in to change notification settings - Fork 4.8k
Closed
Labels
type:questionSupport or code-level questionSupport or code-level question
Description
New Issue Checklist
- I am not disclosing a vulnerability.
- I am not just asking a question.
- I have searched through existing issues.
- I can reproduce the issue with the latest version of Parse Server.
Issue Description
Hi !
Lets say you want to get all documents where the name is not bob or john. The simplest way you can do this is something like this :
Steps to reproduce
const q = new Parse.Query(User)
q.notEqualTo('name', 'bob')
q.notEqualTo('name', 'john')
await q.find()Unfortunatly, this query will be executed as
{
where: {
"name": {
"$ne": "john"
}
}
}Actual Outcome
The results will contains users with name=bob.
Expected Outcome
The objects should not include any 'bob' or 'john'
Alternatively, if multiple notEqualTo is not accepted on the same key, an exception should be thrown on later calls to advise everyone to use notContainedIn or another more appropriate function.
Also, the docs do not reflect this limitation.
Failing Test Case / Pull Request
- 🤩 I submitted a PR with a fix and a test case.
- 🧐 I submitted a PR with a failing test case. 🚀 🔥 Added test case for issue #7459 #7460
Environment
Server
- Parse Server version:
master / 129f7bfa9b7a3252b2d75524f441e81b7c37231c - Operating system:
FILL_THIS_OUT - Local or remote host (AWS, Azure, Google Cloud, Heroku, Digital Ocean, etc):
FILL_THIS_OUT
Database
- System (MongoDB or Postgres):
mongo - Database version: ``
- Local or remote host (MongoDB Atlas, mLab, AWS, Azure, Google Cloud, etc):
local
Client
- SDK (iOS, Android, JavaScript, PHP, Unity, etc):
js - SDK version:
FILL_THIS_OUT
Logs
Metadata
Metadata
Assignees
Labels
type:questionSupport or code-level questionSupport or code-level question