Erlang driver(s)

128 views
Skip to first unread message

Radek

unread,
Feb 15, 2012, 10:11:12 AM2/15/12
to mongodb-user
Hello Group,

I'd like to ask about Erlang support (in terms of driver) in MongoDB.
I'm pretty new to MongoDB and I'm trying to use it in project (in
Erlang) I'm working on and I have problems with official Erlang
MongoDB driver. I can connect to mongo but I can't make any operation,
i.e. I have collection "numbers" in (default) db "test" and when I use
this code (partly copied from github sample) I got this:


9> mongo:do (safe, master, C1, test, fun() -> mongo:count(numbers,
{}) end).

** exception error: no function clause matching
mongo:connection_mode(master,

{ok,{connection,{"localhost",27017},<0.168.0>,infinity}}) (src/
mongo.erl, line 133)
in function mongo:do/5 (src/mongo.erl, line 114)

Where is the problem ?

And second question: is there any real support for "officialy-
supported" Erlang driver ? I'm asking because I see there was no
activity for about half a year, so it seems it's not actively
maintained. Because of that, I don't know if it's suitable for any
real, production usage.
Does anybody have any info ?

Greetings,
Radek

Steve Strong

unread,
Feb 15, 2012, 12:07:36 PM2/15/12
to mongod...@googlegroups.com
Hi,

We're using the official drivers in production - they seem to be working well.  I've found one bug in the bson library, so I would recommend that you pull the driver from http://github.com/TonyGen/mongodb-erlang and the bson library from http://github.com/srstrong/bson-erlang; I did issue a pull request back to the author, but it's never been actioned.  Although the original author does not seem to be actively involved, the code is pretty good so I'm quite happy that it can be maintained over time.  Of course, if there's anything better around I'd also be interested to hear!

From your code, it looks to me as if the C1 value (the connection) is incorrect - I suspect you need an {ok, C1} = blabla() when you get the initial connection…

Cheers,

Steve


-- 
Steve Strong
@srstrong

Sent with Sparrow

--
You received this message because you are subscribed to the Google Groups "mongodb-user" group.
To post to this group, send email to mongod...@googlegroups.com.
To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.
For more options, visit this group at http://groups.google.com/group/mongodb-user?hl=en.

Radek

unread,
Feb 15, 2012, 1:08:24 PM2/15/12
to mongodb-user
Hi Steve,

thanks for you answer. It's good to know there are more Erlang folks
out there :)
And thank you for your answer - now it seems to work.

Greetings,
Radek

On 15 Lut, 18:07, Steve Strong <srstr...@gmail.com> wrote:
> Hi,
>
> We're using the official drivers in production - they seem to be working well.  I've found one bug in the bson library, so I would recommend that you pull the driver fromhttp://github.com/TonyGen/mongodb-erlangand the bson library fromhttp://github.com/srstrong/bson-erlang;I did issue a pull request back to the author, but it's never been actioned.  Although the original author does not seem to be actively involved, the code is pretty good so I'm quite happy that it can be maintained over time.  Of course, if there's anything better around I'd also be interested to hear!
>
> From your code, it looks to me as if the C1 value (the connection) is incorrect - I suspect you need an {ok, C1} = blabla() when you get the initial connection…
>
> Cheers,
>
> Steve
>
> -- Steve Strong
> @srstrong
>
> Sent with Sparrow (http://www.sparrowmailapp.com/?sig)
> > To post to this group, send email to mongod...@googlegroups.com (mailto:mongod...@googlegroups.com).
> > To unsubscribe from this group, send email to mongodb-user...@googlegroups.com (mailto:mongodb-user...@googlegroups.com).

Steve Strong

unread,
Feb 15, 2012, 1:30:19 PM2/15/12
to mongod...@googlegroups.com, mongodb-user
Cool, glad to help. Let me know if there's anything you need that the driver can't do and I might take a look...

Cheers,

Steve

Sent from my iPhone

> To post to this group, send email to mongod...@googlegroups.com.
> To unsubscribe from this group, send email to mongodb-user...@googlegroups.com.

Reply all
Reply to author
Forward
0 new messages