lib/associations.js
function (collectionIdentity) {
      if (!collectionIdentity) return;
      var schema = connectionObject.collections[collectionIdentity].attributes;
      
      if(!schema)
       return 'id'; 
      
      var key;
      for(key in schema){
        if(schema[key].primaryKey)
          return key;
      }
      return 'id';
    }
function (collectionIdentity) {
      if (!collectionIdentity) return;
      var schema = connectionObject.collections[collectionIdentity].attributes;
      
      if(!schema)
       return 'id'; 
      
      var key;
      for(key in schema){
        if(schema[key].primaryKey)
          return key;
      }
      return 'id';
    }
function ( collectionIdentity ) { if ( ! collectionIdentity ) return ; var schema = connectionObject . collections [ collectionIdentity ] . attributes ; if ( ! schema ) return 'id' ; var key ; for ( key in schema ) { if ( schema [ key ] . primaryKey ) return key ; } return 'id' ; }
Look up the name of the primary key field
for the collection with the specified identity.

@param  {String}   collectionIdentity
@return {String}
Look up the name of the primary key field for the collection with the specified identity .