Listening On Open Connection Event

269 views
Skip to first unread message

Michael Yagudaev

unread,
Mar 5, 2012, 1:40:40 AM3/5/12
to Mongoose Node.JS ORM
Hi everyone,

How do you listen to the 'open' event when it fires after doing a
mongoose.createConnection('mongodb://localhost/dbname')?

I want to be able to timeout after 30 seconds or so, if the database
does not respond so I can see the database instance is down or has
some kind of a problem.

Thanks,

Mike

Aaron Heckmann

unread,
Mar 12, 2012, 10:28:01 PM3/12/12
to mongoo...@googlegroups.com
var conn = mongoose.createConnection(...);
conn.on('open', callback)


--
http://mongoosejs.com
http://github.com/learnboost/mongoose
You received this message because you are subscribed to the Google
Groups "Mongoose Node.JS ORM" group.
To post to this group, send email to mongoo...@googlegroups.com
To unsubscribe from this group, send email to
mongoose-orm...@googlegroups.com
For more options, visit this group at
http://groups.google.com/group/mongoose-orm?hl=en



--
Aaron



Reply all
Reply to author
Forward
0 new messages