title: Mongoose find last ten entries in database
body: <p>I am making a simple little Social Network.  I have all the inputting posts, users, etc, done.  The only thing wrong right now is it is pretty much just a chat room.  Whenever you post something on someone's page, the only people that can view it are the people on the page at the time.  When you refresh, all the posts are gone.  Here is the technical part of what I am doing when posts are sent, and what I want to do.</p>
  
  <p>Whenever you post a post, it does somethings that are not important, I will not list them.  But there is one part that is important, sending it to the NodeJS server.  Here is the code it uses:</p>
  
  <pre><code>function sendPost(cont) {
      socket.emit("newPost", username, uid, cont, page);
      model.posts.unshift(new Post(username, uid, cont, page)); // You don't need to worry about this
  }
  </code></pre>
  
  <p>As you can see, it emits a "newPost" with the username, uid, content and page.  On the server, it receives posts with this, and then inserts into a database.</p>
  
  <pre><code>socket.on("newPost", function (name, id, cont, page) {
      var thePost = new Post({name: name, cont: cont, id: id, page: page});
      console.log("Received a new post by "+thePost.name+"(ID of "+thePost.id+"), with the content of \""+thePost.cont+"\", on the page "+thePost.page);
      socket.broadcast.emit("Post", name, id, cont, page);
      console.log("Post sent!");
      console.log("Putting post in database...");
      thePost.save(function (err, thePost) {
          if (err) {
              console.log("Error inserting into database: "+err);
          } else {
              console.log("Put into database finished!");
          }
      });
  });
  </code></pre>
  
  <p>Now for my actual problem/question.  Whenever the page loads, it sends a request to the server like this:</p>
  
  <pre><code>socket.emit("getPrevious", curPage, amount);
  </code></pre>
  
  <p>That works all fine.  On the server, it receives that and does the following:</p>
  
  <pre><code>socket.on("getPrevious", function(curPage, amount) {
      console.log("Someone requested a page update, sending it to them...");
      Post.find({'page': curPage}).sort('-date').execFind(function(err, post){
          console.log("Emitting Update...");
          socket.emit("Update", post.name, post.id, post.cont);       
          console.log("Update Emmited");
      });
  });
  </code></pre>
  
  <p>That code will only find One of the latest posts on that page.  I want it to find the last  of posts, then send them back.  Even with it happening only once, when I go to the page, it will display this:</p>
  
  <pre><code>null says
  </code></pre>
  
  <p>My two questions are this:  How would I make it find the latest  of posts, and why, with only this one, does it return "null"?</p>
  
  <p>Thanks it advance.  If you need any code, tell me.  If anything is unclear, tell me.</p>