v1.18.x
barisusakli 10 years ago
parent 0dca86f255
commit d577371a51

@ -208,12 +208,15 @@ module.exports = function(db, module) {
if (!key || !Array.isArray(fields) || !fields.length) {
return callback();
}
fields = fields.filter(Boolean);
if (!fields.length) {
return callback();
}
var data = {};
fields.forEach(function(field) {
if (field) {
field = helpers.fieldToString(field);
data[field] = '';
}
field = helpers.fieldToString(field);
data[field] = '';
});
db.collection('objects').update({_key: key}, {$unset : data}, function(err, res) {

Loading…
Cancel
Save