File tree 1 file changed +10
-4
lines changed
1 file changed +10
-4
lines changed Original file line number Diff line number Diff line change @@ -43,13 +43,13 @@ module.exports = {
43
43
44
44
sort : {
45
45
description : 'If specified, the rows coming back from the query will be sorted according to this dictionary.' ,
46
- typeclass : 'dictionary'
46
+ example : [ { columnName : 'foo' , direction : 1 } ]
47
47
} ,
48
48
49
49
schema : {
50
50
description : 'An example indicating what each returned row should look like.' ,
51
51
extendedDescription : 'This is used to determine the `columns` (i.e. projection) passed in w/ the query.' ,
52
- typeclass : 'array' ,
52
+ example : [ { fieldName : 'username' , type : 'string' } ] ,
53
53
required : true
54
54
}
55
55
@@ -99,7 +99,7 @@ module.exports = {
99
99
100
100
// Must be a stringified version
101
101
case 'array' :
102
- example [ column . fieldName ] = '[1,2,3 ]' ;
102
+ example [ column . fieldName ] = '[1]' ;
103
103
break ;
104
104
} ;
105
105
} ) ;
@@ -126,8 +126,14 @@ module.exports = {
126
126
127
127
if ( inputs . limit ) query . limit = inputs . limit ;
128
128
if ( inputs . skip ) query . skip = inputs . skip ;
129
- if ( inputs . sort ) query . sort = inputs . sort ;
129
+ if ( inputs . sort ) {
130
+ query . sort = { } ;
130
131
132
+ // Parse array and turn into a WL sort criteria
133
+ inputs . sort . forEach ( function ( sorter ) {
134
+ query . sort [ sorter . columnName ] = sorter . direction ;
135
+ } ) ;
136
+ }
131
137
132
138
// WL SQL options
133
139
var sqlOptions = {
You can’t perform that action at this time.
0 commit comments