allItems.forEach(function(item) {
    byId[item._id] = item;
    ordered.push(item._id);
  });