mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-13 01:15:47 +01:00
changes to leaveAllGroups
Groups.destroy can take an array of groupnames Groups.leave can take an array of groupnames db.incrObjectField/decrObjectField can take an array of keys db.sortedSetRemove can take an array of keys and values db.setRemove can take an array of keys
This commit is contained in:
@@ -11,10 +11,14 @@ module.exports = function (db, module) {
|
||||
if (!key) {
|
||||
return callback();
|
||||
}
|
||||
|
||||
if (Array.isArray(value)) {
|
||||
if (Array.isArray(key) && Array.isArray(value)) {
|
||||
db.collection('objects').remove({ _key: { $in: key }, value: { $in: value } }, done);
|
||||
} else if (Array.isArray(value)) {
|
||||
value = value.map(helpers.valueToString);
|
||||
db.collection('objects').remove({ _key: key, value: { $in: value } }, done);
|
||||
} else if (Array.isArray(key)) {
|
||||
value = helpers.valueToString(value);
|
||||
db.collection('objects').remove({ _key: { $in: key }, value: value }, done);
|
||||
} else {
|
||||
value = helpers.valueToString(value);
|
||||
db.collection('objects').remove({ _key: key, value: value }, done);
|
||||
|
||||
Reference in New Issue
Block a user