nl_tokens: Find out the differences between the clientRecords and the serverRecords
pl_tokens: function computeDelta ( datasetId , clientRecords , serverRecords ) { var creates = { } ; var updates = { } ; var deletes = { } ; _ . each ( serverRecords , function ( serverRecord , serverRecordUid ) { var serverRecHash = serverRecord . hash ; //record is in both client and server if ( clientRecords [ serverRecordUid ] ) { //hash value doesn't match, needs update if ( clientRecords [ serverRecordUid ] !== serverRecHash ) { debug ( '[%s] Updating client record %s  client hash=%s' , datasetId , serverRecordUid , clientRecords [ serverRecordUid ] ) ; updates [ serverRecordUid ] = serverRecord ; } } else { //record is not in the client, needs create debug ( '[%s] Creating client record %s' , datasetId , serverRecordUid ) ; creates [ serverRecordUid ] = serverRecord ; } } ) ; _ . each ( clientRecords , function ( clientRecordHash , clientRecordUid ) { if ( ! serverRecords [ clientRecordUid ] ) { //the record is in the client but not in the server, need delete debug ( '[%s] Deleting client record %s' , datasetId , clientRecordUid ) ; deletes [ clientRecordUid ] = { } ; } } ) ; return { create : creates , <mask> : updates , delete : deletes } ; }