mirror of
https://github.com/NodeBB/NodeBB.git
synced 2025-11-17 19:21:04 +01:00
fix: numeric strings in mongo (#11498)
This commit is contained in:
committed by
GitHub
parent
f8ae6ef7ef
commit
6bed65dde6
@@ -49,15 +49,15 @@ module.exports = function (module) {
|
||||
}
|
||||
|
||||
if (min !== '-inf') {
|
||||
query.score = { $gte: min };
|
||||
query.score = { $gte: parseFloat(min) };
|
||||
}
|
||||
if (max !== '+inf') {
|
||||
query.score = query.score || {};
|
||||
query.score.$lte = max;
|
||||
query.score.$lte = parseFloat(max);
|
||||
}
|
||||
|
||||
if (max === min) {
|
||||
query.score = max;
|
||||
query.score = parseFloat(max);
|
||||
}
|
||||
|
||||
const fields = { _id: 0, _key: 0 };
|
||||
|
||||
Reference in New Issue
Block a user