Commit 3166fc51 authored by josemiguelq's avatar josemiguelq

using normal query when paginating

parent 9df6d1ef
...@@ -235,7 +235,7 @@ class Builder extends BaseBuilder ...@@ -235,7 +235,7 @@ class Builder extends BaseBuilder
$wheres = $this->compileWheres(); $wheres = $this->compileWheres();
// Use MongoDB's aggregation framework when using grouping or aggregation functions. // Use MongoDB's aggregation framework when using grouping or aggregation functions.
if ($this->groups || $this->aggregate || $this->paginating) { if ($this->groups || $this->aggregate) {
$group = []; $group = [];
$unwinds = []; $unwinds = [];
...@@ -280,14 +280,6 @@ class Builder extends BaseBuilder ...@@ -280,14 +280,6 @@ class Builder extends BaseBuilder
} }
} }
// When using pagination, we limit the number of returned columns
// by adding a projection.
if ($this->paginating) {
foreach ($this->columns as $column) {
$this->projections[$column] = 1;
}
}
// The _id field is mandatory when using grouping. // The _id field is mandatory when using grouping.
if ($group && empty($group['_id'])) { if ($group && empty($group['_id'])) {
$group['_id'] = null; $group['_id'] = null;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment