Unable to connect to cosmos db emulator Mongo API 3.6
Asked Answered
R

0

6

I am able to connect to the standard MongoAPI 3.2 version with python as well as Robo 3T after executing the startup with the following:

CosmosDb.Emulator.exe /EnableMongoDbEndpoint

However when starting the emulator with:

CosmosDb.Emulator.exe /EnableMongoDbEndpoint=3.6

I am no longer able to connect with python, only with Robo 3T. I have tried adding a mongoport param and referencing the generated cert with pymongo and but to no avail

import pymongo

from pymongo.errors import ConnectionFailure

uri = 'mongodb://localhost:C2y6yDjf5%2FR%2Bob0N8A7Cgv30VRDJIWEHLM%2B4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw%2FJw%3D%3D@localhost:10255/admin?ssl=true&ssl_cert_reqs=CERT_NONE&retrywrites=false'
try:
    # The is master command is cheap and does not require auth.
    client = pymongo.MongoClient(uri)
    print(client.admin.command('ismaster'))
except ConnectionFailure:
    print("Server not available")
Rationalize answered 5/6, 2020 at 5:6 Comment(1)
What is the error you are getting?Winder

© 2022 - 2024 — McMap. All rights reserved.