mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-31 19:15:58 +01:00
feat: cache group:members for priv groups
This commit is contained in:
@@ -330,7 +330,10 @@ module.exports = function (db, module) {
|
||||
if (!Array.isArray(keys) || !keys.length) {
|
||||
return [];
|
||||
}
|
||||
const data = await db.collection('objects').find({ _key: { $in: keys } }, { projection: { _id: 0, score: 0 } }).sort({ score: 1 }).toArray();
|
||||
|
||||
const data = await db.collection('objects').find({
|
||||
_key: keys.length === 1 ? keys[0] : { $in: keys },
|
||||
}, { projection: { _id: 0, score: 0 } }).sort({ score: 1 }).toArray();
|
||||
|
||||
var sets = {};
|
||||
data.forEach(function (set) {
|
||||
|
||||
Reference in New Issue
Block a user