We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

[feature] mongo $slice

Hi. Yes, odm supports projection. Use the "fields" key.

class Robots extends \Phalcon\Mvc\Collection
{
    // assume parts is an array of parts
    public $parts;
}

Robots::find([
    'fields' => [
        'parts' => [
            '$slice' => 2 // get first two parts for each robot
        ]
    ]
]);