mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-29 18:16:17 +01:00
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:
@@ -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);
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user