Skip to content

Commit 96c247b

Browse files
committed
fixed parameters condition for lt and gt
1 parent 5338332 commit 96c247b

File tree

2 files changed

+7
-0
lines changed

2 files changed

+7
-0
lines changed

common/mixins/parameters.js

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -154,6 +154,12 @@ const cop = (c, v) => {
154154
case 'between':
155155
return (v[k] >= c[k][ck][0]) && (v[k] <= c[k][ck][1]);
156156
break;
157+
case 'lt':
158+
return v[k] < c[k][ck];
159+
break;
160+
case 'gt':
161+
return v[k] > c[k][ck];
162+
break;
157163
}
158164
}
159165
// we need to compare a key of value with a key of condition

test/dataset.test.js

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -203,6 +203,7 @@ describe('Dataset', () => {
203203
},
204204
);
205205

206+
// {"include":[{"relation":"parameters","scope":{"where":{"and":[{"name":"temperature"},{"value":{"lt":80}},{"unit":"celsius"}]}}}]}
206207
context('where parameters has a temperature below 80 °C', () => {
207208
it('should return en array of datasets matching the parameter', (done) => {
208209
const filter = JSON.stringify({

0 commit comments

Comments
 (0)