function _getPK(connectionName, collectionName) {

        var collectionDefinition;

        try {
            collectionDefinition = connections[connectionName].collections[collectionName].definition;
            var pk;

            pk = _.find(Object.keys(collectionDefinition), function _findPK(key) {
                var attrDef = collectionDefinition[key];
                if (attrDef && attrDef.primaryKey)
                    return key;
                else
                    return false;
            });

            if (!pk)
                pk = 'id';
            return pk;
        }
        catch (e) {
            throw new Error('Unable to determine primary key for collection `' + collectionName + '` because ' +
                    'an error was encountered acquiring the collection definition:\n' + require('util').inspect(e, false, null));
        }
    }
function _getPK(connectionName, collectionName) {

        var collectionDefinition;

        try {
            collectionDefinition = connections[connectionName].collections[collectionName].definition;
            var pk;

            pk = _.find(Object.keys(collectionDefinition), function _findPK(key) {
                var attrDef = collectionDefinition[key];
                if (attrDef && attrDef.primaryKey)
                    return key;
                else
                    return false;
            });

            if (!pk)
                pk = 'id';
            return pk;
        }
        catch (e) {
            throw new Error('Unable to determine primary key for collection `' + collectionName + '` because ' +
                    'an error was encountered acquiring the collection definition:\n' + require('util').inspect(e, false, null));
        }
    }
function _getPK ( connectionName , collectionName ) { var collectionDefinition ; try { collectionDefinition = connections [ connectionName ] . collections [ collectionName ] . definition ; var pk ; pk = _ . find ( Object . keys ( collectionDefinition ) , function _findPK ( key ) { var attrDef = collectionDefinition [ key ] ; if ( attrDef && attrDef . primaryKey ) return key ; else return false ; } ) ; if ( ! pk ) pk = 'id' ; return pk ; } catch ( e ) { throw new Error ( 'Unable to determine primary key for collection `' + collectionName + '` because ' + 'an error was encountered acquiring the collection definition:\n' + require ( 'util' ) . inspect ( e , false , null ) ) ; } }
********************************************************************** /* Private Methods
********************************************************************** 
Lookup the primary key for the given collection

@param  {String} connectionName
@param  {String} collectionName
@return {String}
@api private
********************************************************************** / * Private Methods ********************************************************************** Lookup the primary key for the given collection