title: How to fix 'When using `sails-mongo`, primary keys MUST have `columnName: '_id'`'
body: <p>I'm using:</p>
  
  <ul>
  <li>"sails": "1.2.1",</li>
  <li>"sails-mongo": "1.0.1"</li>
  </ul>
  
  <p>when i get documents of a mongodb collection, i've got error like this:</p>
  
  <pre>In model `archive`: 
  debug: The default primary key attribute (`id`) is not set up correctly.
  debug: When using `sails-mongo`, primary keys MUST have `columnName: '_id'`,
  debug: and must _not_ have `autoIncrement: true`.
  debug: Also, in most cases (unless `dontUseObjectIds` has been set to `true` for the model),
  debug: then the `type` of the primary key must also be `string`.
  </pre>
  
  <p><strong>sails.config.datastores.js</strong></p>
  
  <pre><code> module.exports.datastores = {
    default: {
      adapter: 'sails-mongo',
      host: 'localhost',
      port: 27017,
      database: 'test',
    }
  };
  </code></pre>
  
  <p><strong>sails.config.models.js</strong></p>
  
  <pre><code>module.exports.models = {
  
    migrate: 'safe',
    attributes: {
      createdAt: { type: 'number', autoCreatedAt: true, },
      updatedAt: { type: 'number', autoUpdatedAt: true, },
      id: { type: 'string', columnName: '_id' },
    },
    dataEncryptionKeys: {
      default: 'RWcFGJN8+at5E7eIwNCIQxkR7P0nRAW8Fg4c9tzwFTw='
    },
    cascadeOnDestroy: true
  };
  
  </code></pre>
  
  <p><strong>api.models.User.js</strong></p>
  
  <pre><code>module.exports = {
  
    tableName: 'user',
    attributes: {
      name: {
        type: 'string'
      },
      age: {
        type: 'number',
  
      }
    },
  
  };
  </code></pre>
  
  <p>i've got error when i run <strong>api.controllers.UserController.js</strong></p>
  
  <pre><code>module.exports = {
    getUsers: function (req, res) {
      let users = User.find();
      return res.send(users);
    },
  };
  </code></pre>