Hi @vchalmel,
Firstly, do you have to use MongoDB to connect to Cosmos? Or can you also use another way to connect? If so, please ignore the sentences below and only read the last paragraph of my answer.
The MongoDB Server field (which is the only mandatory field) in the Add Database Connection dialog (when set to MongoDB of course) also allows for a complete connection string. You can set a lot of things in this connection string and one of the available options is SSL. So you could try to connect using a string like this:
mongodb://db1.example.net:2500/?ssl=true
I haven't used FME's MongoDB Reader/Writer for a while now. The replicaSet option, for instance, never worked in FME < 2017, so I'm not sure which options are supported or not, but SSL seems a pretty basic one to support... However, if the SSL option does not work, you could retry one more time adding another option to the connection string:
mongodb://db1.example.net:2500/?ssl=true&sslverifycertificate;=false
If that doesn't work, then I'm afraid it's not supported (yet)...
In that case, you might also want to try connecting to Cosmos DB using their DocumentDB API, since that Reader/Writer is also supported by FME and probably takes a more native approach.
Hi @vchalmel,
Firstly, do you have to use MongoDB to connect to Cosmos? Or can you also use another way to connect? If so, please ignore the sentences below and only read the last paragraph of my answer.
The MongoDB Server field (which is the only mandatory field) in the Add Database Connection dialog (when set to MongoDB of course) also allows for a complete connection string. You can set a lot of things in this connection string and one of the available options is SSL. So you could try to connect using a string like this:
mongodb://db1.example.net:2500/?ssl=true
I haven't used FME's MongoDB Reader/Writer for a while now. The replicaSet option, for instance, never worked in FME < 2017, so I'm not sure which options are supported or not, but SSL seems a pretty basic one to support... However, if the SSL option does not work, you could retry one more time adding another option to the connection string:
mongodb://db1.example.net:2500/?ssl=true&sslverifycertificate;=false
If that doesn't work, then I'm afraid it's not supported (yet)...
In that case, you might also want to try connecting to Cosmos DB using their DocumentDB API, since that Reader/Writer is also supported by FME and probably takes a more native approach.
Don't you get the error : "Cannot connect: More than one ':' detected. If this is an ipv6 address, it needs to be surrounded by '[' and ']';" ?
Don't you get the error : "Cannot connect: More than one ':' detected. If this is an ipv6 address, it needs to be surrounded by '[' and ']';" ?
I don't get anything, since I don't use MongoDB anymore and don't have access to an instance... ;)
Try to remove the port (set it in the proper field) and mongodb:// protocol prefix. So like this for example:
db1.example.net/?ssl=true
If that doesn't work, it's probably not supported...
If you desperately need MongoDB connectivity, you can also resort to the
PythonCaller, using the
pymongo or
mongoengine libraries, for instance. I have some good experiences with those, since FME didn't support replica sets (like I mentioned above).
Don't you get the error : "Cannot connect: More than one ':' detected. If this is an ipv6 address, it needs to be surrounded by '[' and ']';" ?
Hi @vchalmel,
I've created a dummy instance (on
mLab) and I can now confirm that the SSL switch is not supported by FME. Sorry for that...
If you'd like to use the standard DB connection technique that FME offers, you might want to
contact Safe. Maybe they know a workaround for you!
If you'd like to take the Python route: I can help you out with that.
Sander
Hi @vchalmel,
I've created a dummy instance (on
mLab) and I can now confirm that the SSL switch is not supported by FME. Sorry for that...
If you'd like to use the standard DB connection technique that FME offers, you might want to
contact Safe. Maybe they know a workaround for you!
If you'd like to take the Python route: I can help you out with that.
Sander
Thanks, I already used python for most mongodb tasks anyway since FME 2016 hadn't implemented the update api ^^