We are moving our forum in GitHub Discussions. For questions about Phalcon v3/v4 you can visit here and for Phalcon v5 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