Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
J
jio
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Romain Courteaud
jio
Commits
91bcd115
Commit
91bcd115
authored
Apr 22, 2022
by
Romain Courteaud
🐸
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
query: sort_on must handle null value
parent
3fa67001
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
25 additions
and
1 deletion
+25
-1
src/queries/query.js
src/queries/query.js
+1
-1
test/queries/tests.js
test/queries/tests.js
+24
-0
No files found.
src/queries/query.js
View file @
91bcd115
...
...
@@ -47,7 +47,7 @@
value
=
[
value
];
}
for
(
i
=
0
;
i
<
value
.
length
;
i
+=
1
)
{
if
(
typeof
value
[
i
]
===
'
object
'
)
{
if
(
(
value
[
i
]
!==
null
)
&&
(
typeof
value
[
i
]
===
'
object
'
)
)
{
new_value
[
i
]
=
value
[
i
].
content
;
}
else
{
new_value
[
i
]
=
value
[
i
];
...
...
test/queries/tests.js
View file @
91bcd115
...
...
@@ -710,4 +710,28 @@
}).
always
(
start
);
});
test
(
'
sort_on options do not raise in case of null value
'
,
function
()
{
var
doc_list
=
[
{
'
a
'
:
null
},
{
'
c
'
:
3
},
{
'
b
'
:
2
}
];
stop
();
expect
(
1
);
jIO
.
QueryFactory
.
create
(
""
).
exec
(
doc_list
,
{
sort_on
:
[[
'
a
'
,
'
ascending
'
]],
}
)
.
then
(
function
(
list
)
{
deepEqual
(
list
,
[
{
'
c
'
:
3
},
{
'
b
'
:
2
},
{
'
a
'
:
null
}
],
'
Sorting didn
\'
t raise
'
);
}).
always
(
start
);
});
}(
jIO
,
jiodate
));
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
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 comment