diff --git a/src/index.js b/src/index.js index 34dff7e..f15885a 100644 --- a/src/index.js +++ b/src/index.js @@ -66,9 +66,10 @@ class Service { // into nested where conditions. if (method) { if (key === '$or') { - return value.forEach(condition => query[method].call(query, condition)); + return query.where(function() { + value.forEach(condition => this[method].call(this, condition)); + }); } - return query[method].call(query, column, value); }