Comments (11)
If you do not have auth use connect/2. It is not documented yet I have made a pull request earlier this week.
from mongodb-erlang.
I still need full-featured connection example. Thanks
from mongodb-erlang.
Here :
mongo:connect(<<"DB">>, [{host, _Host},{port, _Port}])
from mongodb-erlang.
@TheSquad nope, I mean example of connect/6
especially how to set just empty username and password, when I have not any auth at all.
from mongodb-erlang.
@cystbear you can't use connect/6 if you do not have any auth, it won't work, that's is why I created connect/2, to connect to a remote server without credentials.
from mongodb-erlang.
First of all you can use mongo:connect(Database, Options).
It was merged in mongo master some time ago.
You may notice, that mongo:connect
is a wrap around mc_worker:start_link
, which takes proplist of different settings, as argument.
So - if you need something more, than is in mongo:connect
- use mc_worker:start_link
with your settings.
from mongodb-erlang.
@comtihon how to provide empty username
/password
?
{<<"test">>, <<>>, <<>>, slave_ok, unsafe, []}
or how?
from mongodb-erlang.
If you have no auth on database - do not set username and password in options using mongo:connect/2
or do not include them in proplist when using mc_worker:startlink
from mongodb-erlang.
@comtihon but I do not know in advance will user use auth or not, so I am trying to do some universal solution. All params for connection will come from config. That's it.
from mongodb-erlang.
if you wrap a solution around mongodb, then it is up to you to use connect/2 or connect/6 if your user use auth or not...
from mongodb-erlang.
ok
from mongodb-erlang.
Related Issues (20)
- It doesn't seem to support 4.2
- Generic server terminating HOT 4
- Issue connecting to ReplicaSet HOT 2
- Issue connecting to ReplicaSet HOT 7
- Failed to update package rebar_ct from repo hexpm HOT 3
- Are distinct and aggregate command supported? HOT 2
- Maintenance plans? HOT 2
- MongoDB 4.2 cluster "Can't pass authentification" in 2nd erlang node HOT 8
- API Consistency Question HOT 1
- Connection Pool Issue HOT 2
- How to use SSL? HOT 2
- Is collation supported?
- undefined function erlang:get_stacktrace/0 HOT 1
- Exceeded memory limit for $group, but didn't allow external sort. Pass allowDiskUse:true
- Add support for MongoDB 6.X+ HOT 15
- How can I create/drop a collection using the driver HOT 1
- Master-slave switchover error
- Can't canonicalize query :: caused by :: unknown operator: $maxDistance
- OP_QUERY is no longer supported HOT 1
- How to add limit in find function in mongo_api call
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from mongodb-erlang.