orchestrate
Advanced tools
Comparing version 0.4.0 to 0.4.1
@@ -17,6 +17,6 @@ // Copyright 2013 Bowery Software, LLC | ||
var util = require('util'); | ||
util.inherits(SearchBuilder, Builder) | ||
require('util').inherits(SearchBuilder, Builder) | ||
/** | ||
@@ -78,9 +78,13 @@ * Set collection. | ||
* @param {string} path | ||
* @param {string} value | ||
* @param {array} args | ||
* @return {SearchBuilder} | ||
*/ | ||
SearchBuilder.prototype.aggregate = function (type, path, value) { | ||
SearchBuilder.prototype.aggregate = function (type, path, args) { | ||
assert(type, 'type required'); | ||
assert(path, 'path required'); | ||
var _aggregate = [path, type, value].join(':'); | ||
var parts = [ path, type ]; | ||
if (typeof(args) === "string" || util.isArray(args)) { | ||
parts = parts.concat(args); | ||
} | ||
var _aggregate = parts.join(':'); | ||
if (this._aggregate) | ||
@@ -139,10 +143,22 @@ this._aggregate = [this._aggregate, _aggregate].join(','); | ||
/** | ||
* Add new 'time_series' aggregate parameter. | ||
* Add new 'time_series' aggregate parameter. The 'time' param, which must be | ||
* one of ('year', 'quarter', 'month', 'week', 'day', or 'hour'), determines | ||
* the bucketing interval for the time-series. The optional timezone param, | ||
* if present, must begin with a "+" or "-" character, followed by four digits | ||
* representing the hours and minutes of offset, relative to UTC. For example, | ||
* Eastern Standard Time (EST) would be represented as "-0500", since the time | ||
* in EST is five hours behind that of UTC. | ||
* | ||
* @param {string} type | ||
* @param {string} path | ||
* @param {string} value | ||
* @param {string} time | ||
* @param {string} timezone | ||
* @return {SearchBuilder} | ||
*/ | ||
SearchBuilder.prototype.time_series = function (path, time) { | ||
return this.aggregate('time_series', path, time); | ||
SearchBuilder.prototype.time_series = function (path, time, timezone) { | ||
if (typeof(timezone) === "undefined") { | ||
return this.aggregate('time_series', path, time); | ||
} else { | ||
return this.aggregate('time_series', path, [ time, timezone ]); | ||
} | ||
} | ||
@@ -149,0 +165,0 @@ |
@@ -28,3 +28,3 @@ { | ||
}, | ||
"version": "0.4.0", | ||
"version": "0.4.1", | ||
"main": "index", | ||
@@ -31,0 +31,0 @@ "tags": [ |
@@ -123,2 +123,3 @@ // Copyright 2014 Orchestrate, Inc. | ||
.time_series('path', 'day') | ||
.time_series('path', 'hour', '+0900') | ||
.query('value.location:NEAR:{latitude:12.3 longitude:56.7 radius:100km}') | ||
@@ -125,0 +126,0 @@ .then(function (res) { |
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
68458
1600
1