0.0.2 • Published 7 years ago

weather-taiwan-timesearch v0.0.2

Weekly downloads
2
License
MIT
Repository
github
Last release
7 years ago

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<wesleyboy42@gmail.com>

0.0.2

7 years ago

0.0.1

7 years ago