fix: check if unread_tids are followed

This commit is contained in:
Barış Soner Uşaklı
2020-09-11 00:39:45 -04:00
parent 31635e3e58
commit 2d5bd153e0
4 changed files with 22 additions and 2 deletions

View File

@@ -318,6 +318,9 @@ module.exports = function (module) {
if (!key) {
return;
}
if (!values.length) {
return [];
}
values = values.map(helpers.valueToString);
const results = await module.client.collection('objects').find({
_key: key, value: { $in: values },

View File

@@ -410,6 +410,9 @@ SELECT 1
return;
}
if (!values.length) {
return [];
}
values = values.map(helpers.valueToString);
const res = await module.pool.query({

View File

@@ -203,6 +203,9 @@ module.exports = function (module) {
};
module.isSortedSetMembers = async function (key, values) {
if (!values.length) {
return [];
}
const batch = module.client.batch();
values.forEach(v => batch.zscore(key, String(v)));
const results = await helpers.execBatch(batch);