adonis-lucid-mongodb
Advanced tools
Comparing version 0.10.1 to 0.10.2
@@ -8,3 +8,3 @@ { | ||
}, | ||
"version": "0.10.1", | ||
"version": "0.10.2", | ||
"scripts": { | ||
@@ -11,0 +11,0 @@ "lint": "standard", |
@@ -261,3 +261,23 @@ 'use strict' | ||
const relations = _.isArray(arguments[0]) ? arguments[0] : _.toArray(arguments) | ||
target.eagerLoad.with(relations) | ||
relations.forEach(item => { | ||
console.log(item) | ||
if (_.isObject(item)) { | ||
target.eagerLoad.with([item.relation]) | ||
if (item.scope) { | ||
if (_.isObject(item.scope)) { | ||
this.scope(item.relation, function (query) { | ||
if (item.scope.where) { query = query.where(item.scope.where) } | ||
if (item.scope.with) { query = query.with(item.scope.with) } | ||
if (item.scope.limit) { query = query.limit(item.scope.limit) } | ||
if (item.scope.skip) { query = query.skip(item.scope.skip) } | ||
if (item.scope.sort) { query = query.sort(item.scope.sort) } | ||
}) | ||
} else if (item) { | ||
this.scope(item.relation, item.scope) | ||
} | ||
} | ||
} else { | ||
target.eagerLoad.with([item]) | ||
} | ||
}) | ||
return this | ||
@@ -264,0 +284,0 @@ } |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
202741
7428