0: object _msgid: "ce7a3da9.d1435"topic: ""payload: objectlocation: objectdata: objectresponse: objectcurrent_observation: objectimage: objectdisplay_location: objectobservation_location: objectestimated: objectstation_id: "ILIMBURG77"observation_time: "Last Updated on July 19, 12:46 PM CEST"observation_time_rfc822: "Wed, 19 Jul 2017 12:46:40 +0200"observation_epoch: "1500461200"local_time_rfc822: "Wed, 19 Jul 2017 12:46:42 +0200"local_epoch: "1500461202"local_tz_short: "CEST"local_tz_long: "Europe/Amsterdam"local_tz_offset: "+0200"weather: "Clear"temperature_string: "88.2 F (31.2 C)"temp_f: 88.2temp_c: 31.2relative_humidity: "37%"wind_string: "From the WSW at 2.0 MPH Gusting to 2.5 MPH"wind_dir: "WSW"wind_degrees: 249wind_mph: 2wind_gust_mph: "2.5"wind_kph: 3.2wind_gust_kph: "4.0"pressure_mb: "1010"pressure_in: "29.83"pressure_trend: "0"dewpoint_string: "59 F (15 C)"dewpoint_f: 59dewpoint_c: 15heat_index_string: "87 F (31 C)"heat_index_f: 87heat_index_c: 31windchill_string: "NA"windchill_f: "NA"windchill_c: "NA"feelslike_string: "87 F (31 C)"feelslike_f: "87"feelslike_c: "31"visibility_mi: "N/A"visibility_km: "N/A"solarradiation: "665"UV: "4.0"precip_1hr_string: "0.00 in ( 0 mm)"precip_1hr_in: "0.00"precip_1hr_metric: " 0"precip_today_string: "0.00 in (0 mm)"precip_today_in: "0.00"precip_today_metric: "0"icon: "clear"nowcast: ""forecast: objecttime: "2017-07-19T10:46:40.000Z"title: "Data supplied by The Weather Underground."description: "Current weather information at coordinates: 51.49, 6.11"_id: "596f38924bdbfc08ed3297b5"
/*Data manipulation to get the correct datatype for the msg.payload.*/var start = Date.parse("2017-07-20 00:00:00").toString(); // Date "from"var stop = Date.parse("2017-07-20 12:00:00").toString(); // Date "to"
//-------------------------- "SQL" part ------------------------------//SELECT statementmsg.projection = { 'data.current_observation.temp_c' : 1, // 1 returns the field, 0 suppresses the field 'data.current_observation.temp_f' : 1};
//SELECT TOP statementmsg.limit = 10; // returns the first 10 records
//WHERE statementmsg.payload = {'data.current_observation.local_epoch' : { "$gte" : start, // Larger or equal to "$lte" : stop // Smaller or equal to }};
//ORDER BY statementmsg.sort = {'data.current_observation.local_epoch' : 1}; // 1 = ASC, -1 = DESC//-----------------------------------------------------------------------
return msg;