|
|
@ -236,14 +236,12 @@ Index.prototype.revertUpdate = function (oldDoc, newDoc) { |
|
|
|
* @return {Array of documents} |
|
|
|
* @return {Array of documents} |
|
|
|
*/ |
|
|
|
*/ |
|
|
|
Index.prototype.getMatching = function (value) { |
|
|
|
Index.prototype.getMatching = function (value) { |
|
|
|
var _res, res |
|
|
|
var self = this; |
|
|
|
, self = this; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!util.isArray(value)) { |
|
|
|
if (!util.isArray(value)) { |
|
|
|
res = self.tree.search(value); |
|
|
|
return self.tree.search(value); |
|
|
|
} else { |
|
|
|
} else { |
|
|
|
_res = {}; |
|
|
|
var _res = {}, res = []; |
|
|
|
res = []; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
value.forEach(function (v) { |
|
|
|
value.forEach(function (v) { |
|
|
|
self.getMatching(v).forEach(function (doc) { |
|
|
|
self.getMatching(v).forEach(function (doc) { |
|
|
@ -254,8 +252,9 @@ Index.prototype.getMatching = function (value) { |
|
|
|
Object.keys(_res).forEach(function (_id) { |
|
|
|
Object.keys(_res).forEach(function (_id) { |
|
|
|
res.push(_res[_id]); |
|
|
|
res.push(_res[_id]); |
|
|
|
}); |
|
|
|
}); |
|
|
|
} |
|
|
|
|
|
|
|
return res; |
|
|
|
return res; |
|
|
|
|
|
|
|
} |
|
|
|
}; |
|
|
|
}; |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|