lib/storage/sync-updates.js
function doListUpdates(datasetId, criteria, options, callback) {
  debug('[%s] doListUpdates criteria = %j',datasetId,criteria);
  var updatesCollection = mongoClient.collection(getDatasetUpdatesCollectionName(datasetId));
  var docLimit = options && options.limit;
  var cursor = updatesCollection.find(criteria);
  if (docLimit && docLimit > 0) {
    cursor = cursor.limit(docLimit);
  }
  cursor.toArray(function(err, updates) {
    if (err) {
      debugError('[%s] Failed to doListUpdates due to error %s :: criteria = %j' + criteria,datasetId,err,criteria);
      return callback(err);
    }
    return callback(null, updates);
  });
}
function doListUpdates(datasetId, criteria, options, callback) {
  debug('[%s] doListUpdates criteria = %j',datasetId,criteria);
  var updatesCollection = mongoClient.collection(getDatasetUpdatesCollectionName(datasetId));
  var docLimit = options && options.limit;
  var cursor = updatesCollection.find(criteria);
  if (docLimit && docLimit > 0) {
    cursor = cursor.limit(docLimit);
  }
  cursor.toArray(function(err, updates) {
    if (err) {
      debugError('[%s] Failed to doListUpdates due to error %s :: criteria = %j' + criteria,datasetId,err,criteria);
      return callback(err);
    }
    return callback(null, updates);
  });
}
List all the updates that match the given search criteria

@param {String} datasetId
@param {Object} criteria
@param {Object} options
@param {Function} callback