think_elasticsearch
Advanced tools
Comparing version 1.0.16 to 1.0.17
@@ -279,3 +279,3 @@ 'use strict'; | ||
type: _this4.queryObj.type, | ||
id: _this4.queryObj.body.query.id | ||
id: _id | ||
}; | ||
@@ -287,2 +287,5 @@ _this4.logSql && _lib2.default.log((0, _stringify2.default)(condition), 'ES', Date.now()); | ||
return data; | ||
}).catch(function (e) { | ||
//此方法如果找不到,ES回报错误 | ||
return {}; | ||
}); | ||
@@ -573,3 +576,3 @@ }); | ||
if (opitons.hasOwnProperty('where') && (opitons.where.hasOwnProperty('_id') || opitons.where.hasOwnProperty('id'))) { | ||
return this.get(opitons.where.hasOwnProperty('_id') || opitons.where.hasOwnProperty('id')); | ||
return this.get(opitons.where._id || opitons.where.id); | ||
} else { | ||
@@ -576,0 +579,0 @@ return this.query(); |
{ | ||
"name": "think_elasticsearch", | ||
"version": "1.0.16", | ||
"version": "1.0.17", | ||
"description": "基于elasticsearch.js的elasticsearch工具", | ||
@@ -5,0 +5,0 @@ "scripts": { |
@@ -183,3 +183,3 @@ /** | ||
type: this.queryObj.type, | ||
id: this.queryObj.body.query.id | ||
id: _id | ||
} | ||
@@ -191,2 +191,5 @@ this.logSql && lib.log(JSON.stringify(condition), 'ES', Date.now()); | ||
return data; | ||
}).catch(e=>{ | ||
//此方法如果找不到,ES回报错误 | ||
return {} | ||
}) | ||
@@ -444,3 +447,3 @@ }) | ||
if (opitons.hasOwnProperty('where') && (opitons.where.hasOwnProperty('_id') || opitons.where.hasOwnProperty('id'))) { | ||
return this.get(opitons.where.hasOwnProperty('_id') || opitons.where.hasOwnProperty('id')); | ||
return this.get(opitons.where._id || opitons.where.id); | ||
} else { | ||
@@ -447,0 +450,0 @@ return this.query(); |
@@ -12,3 +12,3 @@ /** | ||
db_type: 'es', // 数据库类型 | ||
db_host: '', // 服务器地址 | ||
db_host: '120.27.196.80', // 服务器地址 | ||
db_port: '9200', // 端口 | ||
@@ -31,3 +31,3 @@ db_log: 'info' | ||
.setType('list') | ||
.where({id: '5e97ab25b4620e6a7f027647e6dc3615'}) | ||
.where({_id: '5e97ab25b4620e6a7f027647e6dc3611'}) | ||
//.field('goods,price') | ||
@@ -34,0 +34,0 @@ .find().then(res => { |
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is too big to display
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
Sorry, the diff of this file is not supported yet
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
5570
737151