Comparing version 1.0.0 to 1.1.0
@@ -156,13 +156,3 @@ var elasticsearch = require('elasticsearch'); | ||
this.fields = function (keys) { | ||
var fields = []; | ||
if (isArray(keys)) { | ||
fields = keys; | ||
} else { | ||
var args = Array.prototype.slice.call(arguments); | ||
args.forEach(arguments, function (arg) { | ||
fields.push(arg); | ||
}); | ||
} | ||
var fields = isArray(keys) ? keys : Array.prototype.slice.call(arguments); | ||
this.options.fields = fields; | ||
@@ -169,0 +159,0 @@ return this; |
{ | ||
"name": "elasto", | ||
"version": "1.0.0", | ||
"version": "1.1.0", | ||
"description": "ElasticSearch client", | ||
@@ -5,0 +5,0 @@ "main": "index", |
@@ -273,2 +273,19 @@ 'use strict'; | ||
it('should query specific fields (no array)', function(done) { | ||
Elasto.query({ | ||
index: 'testing', | ||
type: 'tweets' | ||
}) | ||
.fields('name', 'id') | ||
.exec() | ||
.then(function(res) { | ||
var docs = _.pluck(res.hits.hits, 'fields'); | ||
docs.forEach(function(doc){ | ||
_.keys(doc).length.should.equal(2); | ||
}) | ||
}) | ||
.should.eventually.notify(done); | ||
}); | ||
it('should exclude documents', function (done) { | ||
@@ -275,0 +292,0 @@ var response = {}; |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
26054
607