diff --git a/lib/index.js b/lib/index.js index f1170d1b..3330ba68 100644 --- a/lib/index.js +++ b/lib/index.js @@ -284,13 +284,14 @@ utils.mixin(model, new (function () { if (assnType == 'hasMany') { idParam = []; data.forEach(function (item) { - idParam.push(item[idColName]); + idParam.push({id: item[idColName]}); }); + query.or = idParam; } else { idParam = item[idColName]; + query.id = idParam; } - query.id = idParam; model[modelName][queryName](query, opts, callback); }); }