balderdashy / balderdashy/sails

Error using $exists modifier

Open
#4,609 4 comments 0 reactions 0 assignees View on GitHub
does this answer your question? orm
Dominant language
JavaScript
Stars
22.8k
Forks
1.9k
PR merge metrics
No merged PRs in 30d

Description

**Waterline version**: 0.13.5-0
**Node version**: 8.12.0
**NPM version**: 6.4.1
**Operating system**: Ubuntu 16.04


I want to query using complex condition like using exists, neq operators. But this gives error saying "exists" operator is invalid modifier. In v 0.12 it used to work.

```
let users = await global.dbModels.user
.find({
$and:[
{
$or: [
// { isNewUserHijackerJobErrored: true },
// { isNewUserHijackerJobErrored : { $exists : false } }
{ isNewUserHijackerJobInProgress: false },
{ isNewUserHijackerJobInProgress : { $exists : false } }
]
},
{
$or: [
{ newUserHijackerJobStepName : { $neq: konstant.STEP_NAME_FINISHED } },
{ newUserHijackerJobStepName : { $exists : false } }
]
}
]
});
```

Contributor guide

Open the contributing guide

Research direction

The report names no source file or test entry point. Start by reproducing the shown Waterline query on version 0.13.5-0, then trace how the $exists and $neq modifiers are validated. Done means the query's modifier handling is confirmed or corrected and the reported invalid-modifier error is covered by a regression check.

Written by the indexing model from the issue text.

Assessment

Tech stack
javascript, node.js
Domain
backend, database
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.