weather-taiwan-timesearch
v0.0.2
Published
Search the weather record by time and StationID or longitude/latitude
Downloads
1
Readme
Time Search
Search the weather record by time and StationID or longitude/latitude.
Features
- Create the filter of find command for MongoDB.
Installation
Install directly via NPM
$ npm install weather-taiwan-timesearch
Getting started
Write the main application (app.js)
"use strict";
var TimeSearch = require('weather-taiwan-timesearch');
TimeSearch.StringByID(startTime, StationID, function(err, result) {
console.log(result);
})
TimeSearch.StringByGeo(longitude, latitude, startTime, options, function(err, result) {
console.log(result);
})
options is a Object for $near operator, currently only supports $maxDistance operator, the default value is 10000(meters), you can check the mongodb website for more info.
more example
TimeSearch.StringByID('2017-01-26T02:00:00.000Z', '466940', function(err, result) {
console.log(result);
})
TimeSearch.StringByGeo(121.534327, 25.018597, '2017-02-04T21:00:00.000Z', {}, function(err, result) {
console.log(result);
})
TimeSearch.StringByGeo(121.534327, 25.018597, '2017-02-04T21:00:00.000Z', {maxDistance: 10000}, function(err, result) {
console.log(result);
})
Run the main application (app.js)
$ node app.js
License
Licensed under the MIT License
Authors
Copyright(c) 2017 Wesley Tsai<[email protected]>