title: Can't display data with MongoDB, Mongoose, Node.js and Express in CoffeeScript
body: <p>I've got a Node.js, Express setup with Mongo and Mongoose written in CoffeeScript.</p>
  
  <p>I can save data into my collection with this code:</p>
  
  <pre><code># new
  app.get "/admin/new", (req, res) -&gt;
    res.render "admin/new.jade", locals: c: new Content()
  
  # create
  app.post "/admin.:format?", (req, res) -&gt;
      content = new Content(req.body["content"])
      content.save -&gt;
          switch req.params.format
              when "json"
                  res.send content.__doc
              else
                  res.redirect "/"
  </code></pre>
  
  <p>But I can't display any data with this code. The web browser just says "Waiting for localhost..." and the console says nothing.</p>
  
  <pre><code># index
  app.get "/admin.:format?", (req, res) -&gt;
      Content.find().all (contents) -&gt;
          switch req.params.format
              when "json"
                  res.send contents.map((c) -&gt;
                      c.__doc
                  )
              else
                  res.render "admin/index.jade", locals: contents: contents
  </code></pre>