Skip to content
Toggle navigation
Projects
Groups
Snippets
Help
public
/
sequelize
This project
Loading...
Sign in
Toggle navigation
Go to a project
Project
Repository
Issues
0
Merge Requests
0
Pipelines
Wiki
Snippets
Settings
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
不要怂,就是干,撸起袖子干!
Commit cfa51164
authored
Mar 06, 2015
by
Mick Hansen
Browse files
Options
Browse Files
Download
Plain Diff
Merge pull request #3271 from calvintwr/master
$not fix.
2 parents
00db8e98
09d982ac
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
18 additions
and
6 deletions
lib/dialects/abstract/query-generator.js
test/unit/sql/where.test.js
lib/dialects/abstract/query-generator.js
View file @
cfa5116
...
@@ -1582,7 +1582,7 @@ module.exports = (function() {
...
@@ -1582,7 +1582,7 @@ module.exports = (function() {
$gt
:
'>'
,
$gt
:
'>'
,
$lte
:
'<='
,
$lte
:
'<='
,
$lt
:
'<'
,
$lt
:
'<'
,
$not
:
'NOT'
,
$not
:
'
IS
NOT'
,
$is
:
'IS'
,
$is
:
'IS'
,
$like
:
'LIKE'
,
$like
:
'LIKE'
,
$notLike
:
'NOT LIKE'
,
$notLike
:
'NOT LIKE'
,
...
@@ -1710,12 +1710,18 @@ module.exports = (function() {
...
@@ -1710,12 +1710,18 @@ module.exports = (function() {
value
=
{
value
=
{
$in
:
value
$in
:
value
};
};
}
else
if
(
value
.
$not
&&
Array
.
isArray
(
value
.
$not
))
{
}
else
if
(
value
&&
Array
.
isArray
(
value
.
$not
))
{
value
.
$notIn
=
value
.
$not
;
value
.
$notIn
=
value
.
$not
;
delete
value
.
$not
;
delete
value
.
$not
;
}
}
}
}
// normalize $not: non-bool|non-null to $ne
if
(
value
&&
typeof
value
.
$not
!==
'undefined'
&&
[
null
,
true
,
false
].
indexOf
(
value
.
$not
)
<
0
)
{
value
.
$ne
=
value
.
$not
;
delete
value
.
$not
;
}
// Setup keys and comparators
// Setup keys and comparators
if
(
Array
.
isArray
(
value
)
&&
fieldType
instanceof
DataTypes
.
ARRAY
)
{
if
(
Array
.
isArray
(
value
)
&&
fieldType
instanceof
DataTypes
.
ARRAY
)
{
value
=
this
.
escape
(
value
,
field
);
value
=
this
.
escape
(
value
,
field
);
...
...
test/unit/sql/where.test.js
View file @
cfa5116
...
@@ -121,15 +121,21 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
...
@@ -121,15 +121,21 @@ suite(Support.getTestDialectTeaser('SQL'), function() {
testsql
(
'deleted'
,
{
testsql
(
'deleted'
,
{
$not
:
true
$not
:
true
},
{
},
{
default
:
"[deleted] NOT true"
,
default
:
"[deleted]
IS
NOT true"
,
mssql
:
"[deleted] NOT 'true'"
,
mssql
:
"[deleted]
IS
NOT 'true'"
,
sqlite
:
"`deleted` NOT 1"
sqlite
:
"`deleted`
IS
NOT 1"
});
});
testsql
(
'deleted'
,
{
testsql
(
'deleted'
,
{
$not
:
null
$not
:
null
},
{
},
{
default
:
"[deleted] NOT NULL"
default
:
"[deleted] IS NOT NULL"
});
testsql
(
'muscles'
,
{
$not
:
3
},
{
default
:
'[muscles] != 3'
});
});
testsql
(
'muscles'
,
{
testsql
(
'muscles'
,
{
...
...
Write
Preview
Markdown
is supported
Attach a file
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to post a comment