title: sails.js - how to list records from collections?
body: <p>I am using mongodb and I have installed sails-mongodb. I can access mongodb from controller(sails.js). </p>
  
  <p><strong>Issue 1:</strong> I have created a model using sails command, but I dont know how to create function for insert, edit, list and delete. 
  How to load the model into controller?<br>
  How to call the model functions from controller?</p>
  
  <p><strong>Issue 2:</strong> 
  In this following controller, I store the values I intend to user in my view in 'data'. I dont know how to create db functions in model section so I have fetched some data from database using find function, but how do I assign that category values into data.list ?</p>
  
  <pre><code> module.exports = {
   index: function (req, res) {
  
  var data = new Object();
  data.title            = "Page title";   
  data.meta_keywords    = "k1,k2,k3";     
  data.meta_description = "sample data";
      data.lists = "";
  
  Category.find().done(function(err, category) {
      data.lists = category;
  });
  
  bredcrumbs = new Array();
  bredcrumbs[0] = {'text':'Home','link':'Link','active':false};
  res.view("pages/home",data);    
  
  },  
     _config: {}  
  };
  </code></pre>
  
  <p>I have created one model file with named <code>category.js</code></p>
  
  <pre><code>  tableName: 'category',
  
    module.exports = {
  
      attributes: {
        name: {
            type:     'STRING',
            required: true
        },
        keyword: {
            type:     'STRING',
            required: true
        },
        image:        'STRING',
        sort_order: 'INTEGER',
        date_added: 'DATETIME',
        status:   'BOOLEAN'
       },
  
        toJSON: function() {
          var obj = this.toObject();
          return obj;
        }
  }; 
  </code></pre>