I got a flask application running in one vagrant box on (192.168.2.100) and an other vagrant box running mongoDB 3.4 on (192.168.2.110).
When i run this python code from my app:
mongo_client = MongoClient(mongodb://myuser:[email protected]/database_local)
g.db = mongo_client.db.database_local
app_users = g.db.app_users
user_id = app_users.insert_one(
{
'username': 'user',
'password': 'password'
}
).inserted_id
// user_id is created and returned ("592b2c57962d7408027e274d")
// When i run this to verify:
users = g.db.app_users.find()
for user in users:
print(user['username'])
It prints all users inserted...
BUT:
When i ssh into my mongodb and run in mongo console:
use database_local
show collections
it returns nothing, like the database is empty.
app_usersinstead ofdatabase_localwhen you ssh into the machine?