elasticsearch-helper
Advanced tools
Comparing version 1.6.0 to 1.6.1
11
index.js
@@ -104,2 +104,3 @@ 'use strict'; | ||
this.iPageSize = 250; | ||
this.bUpsert = false | ||
@@ -191,2 +192,5 @@ this.oQB = new QueryBuilder(); | ||
if(self.upsert) | ||
oQuery.body.doc_as_upsert = true; | ||
sType = "update"; | ||
@@ -347,2 +351,7 @@ } else if (self.bCount) { | ||
}, | ||
upsert: function(p_oData) { | ||
this.oDoc = p_oData | ||
this.bUpsert = true; | ||
return this; | ||
}, | ||
aggs: function() { | ||
@@ -414,3 +423,3 @@ this.oAB.add.apply(this.oAB, arguments) | ||
var _id = current_doc._id; | ||
var _id = current_doc._id | ||
var _index = current_doc._index; | ||
@@ -417,0 +426,0 @@ var _type = current_doc._type; |
{ | ||
"name": "elasticsearch-helper", | ||
"version": "1.6.0", | ||
"version": "1.6.1", | ||
"description": "A Nodejs module facilitating querying Elasticsearch clusters.", | ||
@@ -29,3 +29,12 @@ "main": "index.js", | ||
"moment": "^2.22.2" | ||
}, | ||
"devDependencies": { | ||
"eslint": "^5.2.0", | ||
"eslint-config-airbnb-base": "^13.0.0", | ||
"eslint-config-standard": "^11.0.0", | ||
"eslint-plugin-import": "^2.13.0", | ||
"eslint-plugin-node": "^7.0.1", | ||
"eslint-plugin-promise": "^3.8.0", | ||
"eslint-plugin-standard": "^3.1.0" | ||
} | ||
} |
@@ -225,2 +225,13 @@ | ||
#### Upsert | ||
```javascript | ||
q.id("ID") | ||
.upsert({...}) // Data object to upsert | ||
.run() | ||
.then(function(hit){ | ||
// return the data object | ||
}) | ||
``` | ||
### Multiple Documents | ||
@@ -227,0 +238,0 @@ |
43010
14
1008
574
7