function checkIndexFieldsMatch(indexFields, sortOrder, fields) {
  if (sortOrder) {
    // array has to be a strict subarray of index array. furthermore,
    // the sortOrder fields need to all be represented in the index
    var sortMatches = oneArrayIsStrictSubArrayOfOther(sortOrder, indexFields);
    var selectorMatches = oneArrayIsSubArrayOfOther(fields, indexFields);

    return sortMatches && selectorMatches;
  }

  // all of the user's specified fields still need to be
  // on the left side of the index array, although the order
  // doesn't matter
  return oneSetIsSubArrayOfOther(fields, indexFields);
}
// in the index. order matters in the case of sorts
in the index. order matters in the case of sorts
in the index . order matters in the case of sorts
function checkIndexFieldsMatch(indexFields, sortOrder, fields) {
  if (sortOrder) {
    var sortMatches = oneArrayIsStrictSubArrayOfOther(sortOrder, indexFields);
    var selectorMatches = oneArrayIsSubArrayOfOther(fields, indexFields);
    return sortMatches && selectorMatches;
  }
  return oneSetIsSubArrayOfOther(fields, indexFields);
}
function checkIndexFieldsMatch ( indexFields , sortOrder , fields ) { if ( sortOrder ) { var sortMatches = oneArrayIsStrictSubArrayOfOther ( sortOrder , indexFields ) ; var selectorMatches = oneArrayIsSubArrayOfOther ( fields , indexFields ) ; return sortMatches && selectorMatches ; } return oneSetIsSubArrayOfOther ( fields , indexFields ) ; }
in the index.
in the index .
// array has to be a strict subarray of index array. furthermore, // the sortOrder fields need to all be represented in the index // all of the user's specified fields still need to be // on the left side of the index array, although the order // doesn't matter