Update influxql.js to use lodash in case of null tags

pull/1201/head
Chris Goller 2017-04-05 23:19:15 -05:00
parent 88bd59d71a
commit 453c6aa582
1 changed files with 4 additions and 1 deletions

View File

@ -1,3 +1,6 @@
import _ from 'lodash'
export default function buildInfluxQLQuery(timeBounds, config) { export default function buildInfluxQLQuery(timeBounds, config) {
const {groupBy, tags, areTagsAccepted} = config const {groupBy, tags, areTagsAccepted} = config
const {upper, lower} = timeBounds const {upper, lower} = timeBounds
@ -54,7 +57,7 @@ function _buildWhereClause({lower, upper, tags, areTagsAccepted}) {
// If a tag key has more than one value, * e.g. cpu=cpu1, cpu=cpu2, combine // If a tag key has more than one value, * e.g. cpu=cpu1, cpu=cpu2, combine
// them with OR instead of AND for the final query. // them with OR instead of AND for the final query.
const tagClauses = Object.keys(tags).map((k) => { const tagClauses = _.keys(tags).map((k) => {
const operator = areTagsAccepted ? '=' : '!=' const operator = areTagsAccepted ? '=' : '!='
if (tags[k].length > 1) { if (tags[k].length > 1) {