Skip to content

Node.js based forum software built for the modern web

closes #4366

barisusaklid52a0ad87a3b
diff --git a/src/database/mongo/hash.js b/src/database/mongo/hash.js
index fe80afaaf4..dbf294119e 100644
--- a/src/database/mongo/hash.js
+++ b/src/database/mongo/hash.js
@@ -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);
});
};
diff --git a/src/search.js b/src/search.js
index ca457d8b0b..9b7306c7fa 100644
--- a/src/search.js
+++ b/src/search.js
@@ -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;
});