UNPKG
contexture-mongo
Version:
latest (0.27.1)
0.27.1
0.27.0
0.26.21
0.26.20
0.26.19
0.26.18
0.26.17
0.26.16
0.26.15
0.26.14
0.26.13
0.26.12
0.26.11
0.26.8
0.26.7
0.26.6
0.26.5
0.26.4
0.26.3
0.26.2
0.26.1
0.26.0
0.25.2
0.25.1
0.25.0
0.24.0
0.23.0
0.22.5
0.22.4
0.22.3
0.22.2
0.22.1
0.22.0
0.21.1
0.21.0
0.20.0
0.19.2
0.19.1
0.19.0
0.18.0
0.17.5
0.17.4
0.17.3
0.17.2
0.17.1
0.17.0
0.16.0
0.15.0
0.14.2
0.14.1
0.13.1
0.13.0
0.12.0
0.11.3
0.11.2
0.11.1
0.11.0
0.10.1
0.10.0
0.9.5
0.9.4
0.9.3
0.9.2
0.9.1
0.9.0
0.8.5
0.8.4
0.8.3
0.8.2
0.8.1
0.8.0
0.7.1
0.7.0
0.6.3
0.6.2
0.6.1
0.6.0
0.5.0
0.4.0
0.3.0
0.2.3
0.2.2
0.2.1
0.2.0
0.1.6
0.1.5
0.1.4
0.1.3
0.1.2
0.1.1
0.1.0
0.0.10
0.0.9
0.0.8
0.0.7
0.0.6
0.0.5
0.0.4
0.0.3
0.0.2
0.0.1
Mongo Provider for Contexture
github.com/smartprocure/contexture-mongo
smartprocure/contexture-mongo
contexture-mongo
/
src
/
example-types
/
number.js
12 lines
(10 loc)
•
277 B
JavaScript
View Raw
1
2
3
4
5
6
7
8
9
10
11
12
var
_ =
require
(
'lodash/fp'
)
module
.
exports
= {
hasValue
:
context
=>
context.
data
.
min
|| context.
data
.
max
,
filter
:
context
=>
({ [context.
field
]: _.
pickBy
(_.
negate
(_.
isNil
), {
$gte
:
Number
(context.
data
.
min
),
$lte
:
Number
(context.
data
.
max
), }), }), }