title: Identify last document from MongoDB find() result set
body: <p>I'm trying to 'stream' data from a node.js/MongoDB instance to the client using websockets. It is all working well.  </p>
  
  <p>But how to I identify the last document in the result? I'm using <a href="https://github.com/christkv/node-mongodb-native">node-mongodb-native</a> to connect to MongoDB from node.js.</p>
  
  <p>A simplified example:</p>
  
  <pre><code>collection.find({}, {}, function(err, cursor) {
    if (err) sys.puts(err.message);
  
    cursor.each(function(err, doc) {
      client.send(doc);
    });                
  });
  </code></pre>