mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-16 10:46:14 +01:00
fix test
This commit is contained in:
@@ -208,12 +208,15 @@ module.exports = function(db, module) {
|
|||||||
if (!key || !Array.isArray(fields) || !fields.length) {
|
if (!key || !Array.isArray(fields) || !fields.length) {
|
||||||
return callback();
|
return callback();
|
||||||
}
|
}
|
||||||
|
fields = fields.filter(Boolean);
|
||||||
|
if (!fields.length) {
|
||||||
|
return callback();
|
||||||
|
}
|
||||||
|
|
||||||
var data = {};
|
var data = {};
|
||||||
fields.forEach(function(field) {
|
fields.forEach(function(field) {
|
||||||
if (field) {
|
field = helpers.fieldToString(field);
|
||||||
field = helpers.fieldToString(field);
|
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, res) {
|
||||||
|
|||||||
Reference in New Issue
Block a user