lib/storage/dataset-clients.js
function listDatasetClientRecords(datasetClientJson, projection, cb) {
  debug('listDatasetClientRecords datasetClientJson = %j', datasetClientJson);
  var datasetId = datasetClientJson.datasetId;
  var datasetRecordsCol = mongoClient.collection(getDatasetRecordsCollectionName(datasetId));
  var cursor = datasetRecordsCol.find({'refs': datasetClientJson.id});
  if (projection) {
    cursor = cursor.project(projection);
  } else {
    cursor = cursor.project({'refs': 0});
  }
  return cursor.toArray(function(err, records) {
    if (err) {
      debug('[%s] Failed to list datasetClient records due to error %s :: datasetClientJson = %j', err, datasetClientJson);
    }
    return cb(err, records);
  });
}
function listDatasetClientRecords(datasetClientJson, projection, cb) {
  debug('listDatasetClientRecords datasetClientJson = %j', datasetClientJson);
  var datasetId = datasetClientJson.datasetId;
  var datasetRecordsCol = mongoClient.collection(getDatasetRecordsCollectionName(datasetId));
  var cursor = datasetRecordsCol.find({'refs': datasetClientJson.id});
  if (projection) {
    cursor = cursor.project(projection);
  } else {
    cursor = cursor.project({'refs': 0});
  }
  return cursor.toArray(function(err, records) {
    if (err) {
      debug('[%s] Failed to list datasetClient records due to error %s :: datasetClientJson = %j', err, datasetClientJson);
    }
    return cb(err, records);
  });
}
List the local records for the given datasetClient from the `fhsync-<datasetId>-records` collection
@param {storage~DatasetClient} datasetClientJson the json object of the datasetClient. It should have the `datasetId` field
@param {Object} projection can be used to specify what fields should be returned for the records. Each record will have `uid`, 'hash' and `data` fields.
@param {Function} cb