diff --git a/lib/scope.js b/lib/scope.js index c1c90eba..f6384856 100644 --- a/lib/scope.js +++ b/lib/scope.js @@ -246,9 +246,15 @@ function mergeQuery(base, update) { } } - // Overwrite inclusion + // Merge inclusion if (update.include) { - base.include = update.include; + if (!base.include) { + base.include = update.include; + } else { + var saved = base.include; + base.include = {}; + base.include[update.include] = [saved]; + } } if (update.collect) { base.collect = update.collect;