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

MongoDB $inc

Hi,

I am searching for help how to increment one field in MongoDB with the phalconphp ODM. Is it possible to use $inc? And how can I perform such a query with the ODM?

https://docs.mongodb.com/manual/reference/operator/update/inc/



43.9k

Hi,

maybe use Phalcon\Mvc\Collection\Document class https://docs.phalcon.io/en/latest/api/Phalcon_Mvc_Collection_Document.html

and manipulate your datas as as an array