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

Overloading OpenConnection function #9

Merged
merged 1 commit into from
Jun 14, 2016

Conversation

rodrigomurta
Copy link
Contributor

Using Connection with Credential to connect using user and password. Tested in Mongo 3.2

Using Connection with Credential to connect using user and password
@@ -124,6 +126,18 @@
DatabaseConnection[host, port, JavaNew["com.mongodb.MongoClient", host, port]]
]

OpenConnection[host_String, port_Integer, "", _, _]:= OpenConnection[host, port]
Copy link
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the use case for this overload? Having a blank string seems to make it very specific, or is that standard for indicating anonymous authentication?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@zbjornson you got the point. When you want anonymous authentication, you can still use OpenConnection with 5 parameters, using user as "". In my case, I read these parameters from a txt file, and I can still read the same number of fields to use OpenConnection, even for anonymous case. Using user -> "", pass -> "" , base -> "". And what matter is the user.

@zbjornson
Copy link
Owner

Thanks for the PR!

@rodrigomurta
Copy link
Contributor Author

@zbjornson Thank you for MongoDBLink, It's a very useful package. I use a lot.

@zbjornson zbjornson merged commit 8017b4f into zbjornson:master Jun 14, 2016
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 this pull request may close these issues.

2 participants