Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Documentation suggestion: Explanation of uri_mode: true for a cloud-based MongoDB solution #484

Closed
Andrew-S-Rosen opened this issue Mar 10, 2022 · 1 comment · Fixed by #485

Comments

@Andrew-S-Rosen
Copy link
Member

Andrew-S-Rosen commented Mar 10, 2022

It took me a while to figure out that if I want to use a URI for a MongoDB, I need to set uri_mode: true in the my_launchpad.yaml file. This is a bit inconsistent with how atomate2/jobflow/maggma behave.

I think it would be worthwhile to add some information to the documentation about using the uri_mode: true flag when trying to access a cloud MongoDB system (e.g. MongoDB Atlas). The appropriate spot would be here.

The relevant code is below for context:

if uri_mode:
self.connection = MongoClient(host)
dbname = host.split("/")[-1].split("?")[0] # parse URI to extract dbname
self.db = self.connection[dbname]
else:
self.connection = MongoClient(
self.host,
self.port,
socketTimeoutMS=MONGO_SOCKET_TIMEOUT_MS,
username=self.username,
password=self.password,
authSource=self.authsource,
**self.mongoclient_kwargs,
)

@janosh
Copy link
Member

janosh commented Apr 6, 2022

Related: The atomate docs could also use a bit more guidance for connecting to Atlas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants