fixed Date query
This commit is contained in:
parent
19d73a37d5
commit
9db5791932
@ -21,11 +21,15 @@ export default function Overview() {
|
|||||||
if (activeDevice === null || activeDevice === undefined) {
|
if (activeDevice === null || activeDevice === undefined) {
|
||||||
return [];
|
return [];
|
||||||
} else {
|
} else {
|
||||||
return SensorDataCollection.find({device_id: activeDevice.deviceId}, {
|
return SensorDataCollection.find(
|
||||||
timestamp: { $gt: moment(Date.now()).subtract(1, 'days').toDate() },
|
{
|
||||||
sort: { timestamp: -1 },
|
device_id: activeDevice.deviceId,
|
||||||
//limit: 1440
|
timestamp: { $gt: moment(Date.now()).subtract(2, 'days').toDate() }
|
||||||
}).fetch().reverse();
|
},
|
||||||
|
{
|
||||||
|
sort: { timestamp: -1 }
|
||||||
|
}
|
||||||
|
).fetch().reverse();
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
|
|||||||
Loading…
Reference in New Issue
Block a user