title: How to set Backbone Model.idAttribute?
body: <p>I'm using MongoDb/Lithium php framework with backbone.</p>
  
  <p>I want all my model id(s) and idAttribute(s) to be same as my database document id (i.e '_id'/mongoid)</p>
  
  <p>Questions:</p>
  
  <ol>
  <li>When I print the value of model.idAttribute, it is shown as just _id. </li>
  <li>When I print model.get('idAttriubte'), it is undefined.</li>
  <li>How do I ensure that the idAttribute is set as the same as the database id/mongoid?</li>
  </ol>
  
  <p>Here is the model class:</p>
  
  <pre><code>window.app.IHoliday = Backbone.Model.extend({
      urlRoot: HOLIDAY_URL,
      idAttribute: '_id',
      id: '_id',
      // Default attributes for the holiday.
      defaults: {
      },
  
      initialize: function(props) {
      },      
  });
  </code></pre>
  
  <p>Here is the view code, calling fetch on the model. The mongoid for the document is passed to this page as a hidden input (holiday_id).</p>
  
  <pre><code>console.log('Holiday URL:' + HOLIDAY_URL );
          var Holiday = new window.app.IHoliday({ _id: holiday_id });
          console.log('HOLIDAY before fetch: \n' + JSON.stringify(Holiday));
          Holiday.fetch(
                  {
                      success: function(){
                          //alert('Holiday fetched:' + JSON.stringify(Holiday));
                          console.log('HOLIDAY Fetched: \n' + JSON.stringify(Holiday));
                          console.log('Holiday name:' + Holiday.get('holiday_name'));
                          console.log('Holiday id:' + Holiday.id);
                          console.log('Holiday idAttribute:' + Holiday.idAttribute);
                          console.log('Holiday idAttribute:' + Holiday.get('idAttribute'));
                      }
                  });
  </code></pre>
  
  <p>The output from firebug console:</p>
  
  <pre><code>HOLIDAY before fetch:{"_id":"50bcaab24fbe3dfc1700000b"}
  GET http://localhost:8080/li3/holidays/load/50bcaab24fbe3dfc1700000b 200 OK
  
  HOLIDAY Fetched: 
  {"_id":"50bcaab24fbe3dfc1700000b","holiday_name":"eeeeeeeeeeeeeeeee","description":"","star_rating":"3","holiday_type":"family","rooms":"1","adults":"2","child":"0","emails":""}
  
  Holiday name:eeeeeeeeeeeeeeeee
  Holiday id:50bcaab24fbe3dfc1700000b
  Holiday idAttribute:_id
  Holiday idAttribute:undefined
  </code></pre>
  
  <p>EDIT:
  The following worked...after commenting out the entry for id in the model class:</p>
  
  <pre><code>    window.app.IHoliday = Backbone.Model.extend({
      urlRoot: HOLIDAY_URL,
      //id: '_id',
      idAttribute: '_id',
      // Default attributes for the holiday.
      defaults: {
      },
  
      initialize: function(props) {
      },
  </code></pre>