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.

How to create connection to MongoDB?

How to create connection to MongoDB?

I can't create a connection to MongoDB, I do not know where to configure the connection.

http://docs.phalconphp.com/en/latest/reference/odm.html Where do I put the code:

// Simple database connection to localhost 
$di-> set ('mongo', function () {
     $ mongo = new MongoClient (); 
     return $ mongo->selectDB("store"); 
}, True); 

// Connecting to a domain socket, falling back to localhost connection 
$ di->set('mongo', function () {
     $ mongo = new MongoClient("mongodb:///tmp/mongodb-27017.sock,localhost:27017"); 
     return $ mongo->selectDB("store"); 
}, True);

Could someone help?



219

Hii,

You can create the mongo db connection just visit https://zappysys.com/blog/ssis-loading-data-into-mongodb-upsert-update-delete-insert/ it will create mongo db connection. I hope it will solve your mongo db connection issue.