Dotini URI string issue

Hi, I renamed my dotini_unix file and configured it like this:

[PROD]

SECRET_KEY = blahblahblaaaah

MFLIX_DB_URI = mongodb+srv://m220student:keepingthisasecret@mflix-vzr6e.mongodb.net/sample_mflix?retryWrites=true&w=majority

MFLIX_NS = sample_mflix

[TEST]

SECRET_KEY = testingblahblahblaaah

MFLIX_DB_URI = mongodb+srv://m220student:keepingthisasecret@mflix-vzr6e.mongodb.net/sample_mflix?retryWrites=true&w=majority 

MFLIX_NS = sample_mflix

…and changed test provided by the Connect page to sample_mflix in the URI string. Questions: should I be using sample_mflix here instead of mflix that I saw in some examples on this board? This isn’t clear in the README. Also, is ?retryWrites=true&w=majority necessary?

Yes, we have updated database name from mflix to sample_mflix.

You can try without using it as well. I have my connection string in .ini file like below:

  MFLIX_DB_URI =  mongodb+srv://m220student:m220password@mflix-21t7x.mongodb.net 

Point of having them is retryWrites will enable you to retry writes if they encounter any network error. And w=majority will ensure that write acknowledgment is for majority of the nodes.

Kanika

1 Like