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

ODM $inc[SOLVED]

How can I use $inc operator for update document? In documentation I didn't find solution.



2.6k
Accepted
answer
$this->mongo->selectCollection("news")->update(
                array('_id' => $id), array('$inc' => array(
                'views' => 1
            ))
        );