mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-12 00:45:47 +01:00
closes #4366
This commit is contained in:
@@ -1,7 +1,5 @@
|
||||
"use strict";
|
||||
|
||||
var winston = require('winston');
|
||||
|
||||
module.exports = function(db, module) {
|
||||
var helpers = module.helpers.mongo;
|
||||
|
||||
@@ -121,9 +119,8 @@ module.exports = function(db, module) {
|
||||
}
|
||||
|
||||
var map = helpers.toMap(items);
|
||||
var returnData = [],
|
||||
index = 0,
|
||||
item;
|
||||
var returnData = [];
|
||||
var item;
|
||||
|
||||
for (var i=0; i<keys.length; ++i) {
|
||||
item = map[keys[i]] || {};
|
||||
@@ -219,7 +216,7 @@ module.exports = function(db, module) {
|
||||
data[field] = '';
|
||||
});
|
||||
|
||||
db.collection('objects').update({_key: key}, {$unset : data}, function(err, res) {
|
||||
db.collection('objects').update({_key: key}, {$unset : data}, function(err) {
|
||||
callback(err);
|
||||
});
|
||||
};
|
||||
|
||||
@@ -85,7 +85,9 @@ function searchInContent(data, callback) {
|
||||
topics.getMainPids(results.tids, next);
|
||||
},
|
||||
function(mainPids, next) {
|
||||
results.pids = mainPids.concat(results.pids).filter(function(pid, index, array) {
|
||||
results.pids = mainPids.concat(results.pids).map(function(pid) {
|
||||
return pid && pid.toString();
|
||||
}).filter(function(pid, index, array) {
|
||||
return pid && array.indexOf(pid) === index;
|
||||
});
|
||||
|
||||
|
||||
Reference in New Issue
Block a user