cphalcon icon indicating copy to clipboard operation
cphalcon copied to clipboard

[NFR] Phalcon\Mvc\Collection support for hint

Open omgnull opened this issue 12 years ago • 3 comments

Hint support feature will be great to tell mongo which index to use.

Robots::find([
    'conditions' => [
        'material' => $plastic,
        'price'    => $price
    ],
    'sort' => [
        'price' => 1
    ],
    'hint' => [
        'price'    => 1
    ]
]);

Also it will be great to explain support.

Robots::find([
    'conditions' => [],
    'explain' => true
]);

Workaround example at the moment:

Robots::find([
    'conditions' => [
        '$query'   => [],
        '$hint'    => [
            '_id' => 1
        ],
        '$explain' => 1
    ]
]);

Want to back this issue? Post a bounty on it! We accept bounties via Bountysource.

omgnull avatar Feb 14 '14 05:02 omgnull

+1

tanagorns avatar Oct 04 '14 14:10 tanagorns

The use of both $hint and $explain in queries is deprecated as of mongodb 3.0. So if an implementation is to be made, it would need to be on the cursor returned.

Green-Cat avatar Apr 02 '16 22:04 Green-Cat

Thank you for contributing to this issue. As it has been 90 days since the last activity, we are automatically closing the issue. This is often because the request was already solved in some way and it just wasn't updated or it's no longer applicable. If that's not the case, please feel free to either reopen this issue or open a new one. We will be more than happy to look at it again! You can read more here: https://blog.phalconphp.com/post/github-closing-old-issues

stale[bot] avatar Apr 17 '18 01:04 stale[bot]