Commit 8f70329b authored by Dimasdanz's avatar Dimasdanz

Fix select columns

Revert previous projections since select columns is using projection.
parent 4d1a7fa2
......@@ -285,6 +285,11 @@ class Builder extends BaseBuilder {
$columns[$column] = true;
}
// Add custom projections.
if ($this->projections)
{
$columns = array_merge($columns, $this->projections);
}
$options = [];
// Apply order, offset, limit and projection
......@@ -292,7 +297,7 @@ class Builder extends BaseBuilder {
if ($this->orders) $options['sort'] = $this->orders;
if ($this->offset) $options['skip'] = $this->offset;
if ($this->limit) $options['limit'] = $this->limit;
if ($this->projections) $options['projection'] = $this->projections;
if ($columns) $options['projection'] = $columns;
// if ($this->hint) $cursor->hint($this->hint);
// Fix for legacy support, converts the results to arrays instead of objects.
......
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