lib/document.js
/**
 * Used primarily in compound indexes. Returns a comparison function usable as
 * an Index's compareKeys function.
 */
Used primarily in compound indexes. Returns a comparison function usable as
an Index's compareKeys function.
Used primarily in compound indexes . Returns a comparison function usable as an Index ' s compareKeys function .
function compoundCompareThings (fields) {
  return function (a, b) {
    var i, len, comparison;
    if (a === undefined) { return b === undefined ? 0 : -1; }
    if (b === undefined) { return a === undefined ? 0 : 1; }
    if (a === null) { return b === null ? 0 : -1; }
    if (b === null) { return a === null ? 0 : 1; }
    for (i = 0, len = fields.length; i < len; i++) {
      comparison = compareThings(a[fields[i]], b[fields[i]]);
      if (comparison !== 0) { return comparison; }
    }
    return 0;
  };
}
function compoundCompareThings ( fields ) { return function ( a , b ) { var i , len , comparison ; if ( a === undefined ) { return b === undefined ? 0 : - 1 ; } if ( b === undefined ) { return a === undefined ? 0 : 1 ; } if ( a === null ) { return b === null ? 0 : - 1 ; } if ( b === null ) { return a === null ? 0 : 1 ; } for ( i = 0 , len = fields . length ; i < len ; i ++ ) { comparison = compareThings ( a [ fields [ i ] ] , b [ fields [ i ] ] ) ; if ( comparison !== 0 ) { return comparison ; } } return 0 ; } ; }
Used primarily in compound indexes.
Used primarily in compound indexes .
// undefined // null