Skip to content
This repository has been archived by the owner on Nov 11, 2020. It is now read-only.

make Builder::elemMatch acting on select, not only on query #101

Closed
abmar opened this issue Mar 27, 2013 · 0 comments
Closed

make Builder::elemMatch acting on select, not only on query #101

abmar opened this issue Mar 27, 2013 · 0 comments
Assignees
Milestone

Comments

@abmar
Copy link

abmar commented Mar 27, 2013

hi there, and thanks for the great job you re doing here.
my concern is about use of Builder :: elemMatch in the select part of the query builder,
the available elemMatch method of query builder is now usable only as part of query part not the projection one.

would it be possible to add something like selectSlice to do so :

public function selectElemMatch($fieldName, $elemMatch)
{

    $this->query['select'][$fieldName] = array($this->cmd . 'elemMatch' => $elemMatch);
    return $this;
}

or simply modify the select method to with a second argument (defaults to 1), to hold the elemMatch filter condition.

Regards

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants