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

Switching between databases from authenticate to dbAggregate #24

Open
tomschenkjr opened this issue Dec 11, 2013 · 1 comment
Open

Switching between databases from authenticate to dbAggregate #24

tomschenkjr opened this issue Dec 11, 2013 · 1 comment

Comments

@tomschenkjr
Copy link

It appears the steps, mongoDbConnect -> dbAuthenticate -> dbAggregate limits the use of switching between databases after authentication. For instance, authenticating with "foo" database, then switching to "bar".

username = ""
password = ""
mongo <- mongoDbConnect("foo")
authenticated <- dbAuthenticate(mongo, username, password)
# Following will not run because data is within "bar" database
counts <- dbAggregate(mongo, "collection", ... )
@tc
Copy link
Owner

tc commented Dec 11, 2013

Would the workaround of making a second connection be suitable?

mongoConn1 <- mongoDbConnect("foo")
mongoConn2 <- mongoDbConnect("bar")

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

No branches or pull requests

2 participants