convert min/max to float

This commit is contained in:
Barış Soner Uşaklı
2017-08-20 20:41:25 -04:00
parent e895f30c8e
commit 329bfeeb3b
2 changed files with 20 additions and 4 deletions

View File

@@ -41,11 +41,11 @@ module.exports = function (db, module) {
var query = { _key: { $in: keys } };
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);
}
db.collection('objects').remove(query, function (err) {
@@ -53,3 +53,5 @@ module.exports = function (db, module) {
});
};
};