Skip to content

Commit 3166fc5

Browse files
committed
using normal query when paginating
1 parent 9df6d1e commit 3166fc5

File tree

1 file changed

+2
-10
lines changed

1 file changed

+2
-10
lines changed

src/Jenssegers/Mongodb/Query/Builder.php

Lines changed: 2 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -235,7 +235,7 @@ public function getFresh($columns = [])
235235
$wheres = $this->compileWheres();
236236

237237
// Use MongoDB's aggregation framework when using grouping or aggregation functions.
238-
if ($this->groups || $this->aggregate || $this->paginating) {
238+
if ($this->groups || $this->aggregate) {
239239
$group = [];
240240
$unwinds = [];
241241

@@ -279,15 +279,7 @@ public function getFresh($columns = [])
279279
}
280280
}
281281
}
282-
283-
// When using pagination, we limit the number of returned columns
284-
// by adding a projection.
285-
if ($this->paginating) {
286-
foreach ($this->columns as $column) {
287-
$this->projections[$column] = 1;
288-
}
289-
}
290-
282+
291283
// The _id field is mandatory when using grouping.
292284
if ($group && empty($group['_id'])) {
293285
$group['_id'] = null;

0 commit comments

Comments
 (0)