final fix for #1884

fix mongo functions so they return correct data if duplicate keys are
passed. getObjects(['post:1', 'post:1'], callback) was only returning
one object.
This commit is contained in:
barisusakli
2014-07-24 12:41:22 -04:00
parent 3557aa2f9a
commit 8dce99250b
3 changed files with 14 additions and 23 deletions

View File

@@ -155,11 +155,12 @@ module.exports = function(db, module) {
return callback(err);
}
var returnData = [],
var map = helpers.toMap(result),
returnData = [],
item;
for(var i=0; i<keys.length; ++i) {
item = helpers.findItem(result, keys[i]);
item = map[keys[i]];
returnData.push(item ? item.score : null);
}