Some fixes on the last commit

This commit is contained in:
Zaid Abdulla committed 2016-07-13 02:33:39 +03:00
1 parent e5a21d2b40
commit 788bd98c8c
2 files changed
+5 -5

No files matched your search

+3 -3
View File
@@ -256,7 +256,7 @@ fetchDevice = (id, timestamp, patterns, callback) ->
loaded.push([pattern, 1])
if pattern.length == 0
projection['_timestamp'] = 1
else if not pattern[0]?
else if pattern[0] == '*'
projection[''] = 1
else if pattern[0] == 'Events'
if pattern.length == 1
@@ -264,7 +264,7 @@ fetchDevice = (id, timestamp, patterns, callback) ->
{exist: timestamp, object: timestamp, writable: timestamp},
{exist: 1, object: 1, writable: 0}])
else if pattern.length == 2
if not pattern[1]?
if pattern[1] == '*'
projection['_registered'] = 1
projection['_lastInform'] = 1
projection['_lastBootstrap'] = 1
@@ -285,7 +285,7 @@ fetchDevice = (id, timestamp, patterns, callback) ->
{exist: 1, object: 1, writable: 0}])
else if pattern.length == 2
if not pattern[1]?
if pattern[1] == '*'
projection['_id'] = 1
projection['_deviceId._Manufacturer'] = 1
projection['_deviceId._ProductClass'] = 1
+2 -2
View File
@@ -44,7 +44,7 @@ sandbox.context.Date = class
return new Date(sandbox.timestamp)
now: () ->
@now: () ->
return sandbox.timestamp
@@ -72,7 +72,7 @@ sandbox.context.declare = (decs) ->
for attrName, dec of v
if Array.isArray(dec)
decT[attrName] = dec[0]
decV[attrName] = dec[1] if 1 in dec
decV[attrName] = dec[1] if 1 of dec
else
decT[attrName] = dec