Solved thread

This post is marked as solved. If you think the information contained on this thread must be part of the official documentation, please contribute submitting a pull request to its repository.

ODM $inc[SOLVED]

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



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