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