Question: I do have a database named users but pymongo is looking for a db named as app is there any way to change to Pymongo connection method ?

this one is working if i crate a db named as app; 

```
app = Flask(__name__)
mongo = PyMongo(app)

```

i want to connect like this but i do get an error for that ; 

```
mongo = PyMongo('users')

```

Answer: 
I have found my answer;

```
client = MongoClient('localhost')
db = client['dbname']
collection = db.collection_name

```
```
app = Flask(__name__)
app.config['MONGO_DBNAME'] = 'dbname'
mongo = PyMongo(app)

```

This allows you to use `flask_pymongo`, more info [here](http://www.bogotobogo.com/python/MongoDB_PyMongo/python_MongoDB_RESTAPI_with_Flask.php)