mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-10-26 16:46: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)) {
|
if ((start < 0 && start > stop) || (isArray && !key.length)) {
|
||||||
return [];
|
return [];
|
||||||
}
|
}
|
||||||
|
const query = { _key: key };
|
||||||
if (isArray) {
|
if (isArray) {
|
||||||
if (key.length > 1) {
|
if (key.length > 1) {
|
||||||
key = { $in: key };
|
query._key = { $in: key };
|
||||||
} else {
|
} else {
|
||||||
key = key[0];
|
query._key = key[0];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
var query = { _key: key };
|
|
||||||
|
|
||||||
if (min !== '-inf') {
|
if (min !== '-inf') {
|
||||||
query.score = { $gte: min };
|
query.score = { $gte: min };
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user