Updating Mongo document from Node
===

so I am inserting a document into mongo db as such


    io.sockets.on('connection', function (socket) {
    	connectLog(socket.handshake.address.address);
    
    function connectLog(ipAddress) {
       db.collection('tracking', function (err, collection) {
    		var currentTime = new Date();
    		var doc={"ip":ipAddress, "connect": currentTime, "culture": "en" };
    		collection.insert(doc, function () { });
        });
     
    }

I have another event


    function logout(id, disconnect) {

I'd like to update (or replace?) that record and add `disconnect: (time)` to it.  How would I go about doing this?   This way I can tell when a person connects and when they disconnect from the chat.

I am using socket.io so I'll know their exact disconnect time

Thank you in advance

