mongodb - create mongo connection handler with python -


How to write mongo connection handlers with pongo? I want to ask for a connection to all the modules in my program. I mean use pymongo MongoClient for example and write handler for it.

For example in your application anywhere, such as a __ init __.py and then import that object wherever you want it to be used. Customer enforces connection pooling, so you should be correct without writing any additional handlers.

Example:

  ap / __init__.py db = Mongo client ()   

and then

  App / ModuleApplication DB    

Comments

Popular posts from this blog

How can I add a seperate action listener to all 14 of my buttons at once that can determine player turn?(java) -

php - Sorting an multidimension array using usort fails -

Simple file compression in C -