Translate special fields in precondition filter
This commit is contained in:
1 parent
48f861a6a5
commit
9db29bb55d
1 file changed
+11
@@ -289,6 +289,17 @@ convertMongoQueryToFilters = (query, filters) ->
|
|||||||
v = v.replace(/[^a-zA-Z0-9\-]+/g, '_')
|
v = v.replace(/[^a-zA-Z0-9\-]+/g, '_')
|
||||||
filters["Tags.#{v}"] = true
|
filters["Tags.#{v}"] = true
|
||||||
else
|
else
|
||||||
|
switch k
|
||||||
|
when '_id' then k = 'DeviceID.ID'
|
||||||
|
when '_deviceId._Manufacturer' then k = 'DeviceID.Manufacturer'
|
||||||
|
when '_deviceId._OUI' then k = 'DeviceID.OUI'
|
||||||
|
when '_deviceId._ProductClass' then k = 'DeviceID.ProductClass'
|
||||||
|
when '_deviceId._SerialNumber' then k = 'DeviceID.SerialNumber'
|
||||||
|
when '_lastInform' then k = 'Events.Inform'
|
||||||
|
when '_lastBootstrap' then k = 'Events.0_BOOTSTRAP'
|
||||||
|
when '_lastBoot' then k = 'Events.1_BOOT'
|
||||||
|
when '_registered' then k = 'Events.Registered'
|
||||||
|
|
||||||
if common.typeOf(v) is common.OBJECT_TYPE
|
if common.typeOf(v) is common.OBJECT_TYPE
|
||||||
for kk, vv of v
|
for kk, vv of v
|
||||||
switch kk
|
switch kk
|
||||||
|
|||||||
Reference in new issue
Block a user