Reputation: 659
hopefully someone can help me. I'm using sails and sails-mongo to connect to my Mongo DB replicaSet. This is all done via config in Sails, so I do not actually create the connection using the MongoDB driver myself, Sails and the ORM (Waterline) take care of it all for me.
Mainly for logging purposes, I'd like to be able to log any Mongo events (connect, disconnect, reconnect etc), and ideally, I'd like to be able to do this without having to create a new separate MongoDB connection just for this purpose.
Does anyone know how I can hook into the MongoDB events/callbacks of the connection that Waterline/sails-mongo creates?
Upvotes: 0
Views: 192
Reputation: 1031
This is not possible at that time. The feature has been asked tho.
You can use .native()
on models to access the mongo collection instance but it only concern queries.
Of course you can use require('mongodb')
directly but you won't have the waterline wrapper on it. it's up to you.
Upvotes: 1