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

A way to use mongo without a model

Hi all,

is there a way in Phalcon to use Mongo DB without ODM? I'm just looking for a connection to Mongo so I can perform some queries. Any help would be appreciated.

You can try to look at

$this->di->get('db')

And work directly with it.



2.1k

Well since you are using mongo db, you should have the php mongo client dll.

so you can always use this.

https://php.net/manual/en/class.mongoclient.php