mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 08:36:12 +01:00
refactor: dont modify key
This commit is contained in:
@@ -36,17 +36,15 @@ module.exports = function (module) {
|
||||
if ((start < 0 && start > stop) || (isArray && !key.length)) {
|
||||
return [];
|
||||
}
|
||||
|
||||
const query = { _key: key };
|
||||
if (isArray) {
|
||||
if (key.length > 1) {
|
||||
key = { $in: key };
|
||||
query._key = { $in: key };
|
||||
} else {
|
||||
key = key[0];
|
||||
query._key = key[0];
|
||||
}
|
||||
}
|
||||
|
||||
var query = { _key: key };
|
||||
|
||||
if (min !== '-inf') {
|
||||
query.score = { $gte: min };
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user