handle empty set, add test

This commit is contained in:
Barış Soner Uşaklı
2018-11-11 15:39:17 -05:00
parent afa6c71b72
commit f8e219c323
3 changed files with 14 additions and 7 deletions

View File

@@ -36,6 +36,9 @@ module.exports = function (db, module) {
}
if (Array.isArray(key)) {
if (!key.length) {
return setImmediate(callback, null, []);
}
key = { $in: key };
}