code: function checkFieldsLogicallySound(indexFields, selector) {
    var firstField = indexFields[0];
    var matcher = selector[firstField];
  
    if (typeof matcher === 'undefined') {
      return true;
    }
  
    var hasLogicalOperator = Object.keys(matcher).some(function (matcherKey) {
      return !(isNonLogicalMatcher(matcherKey));
    });
  
    if (!hasLogicalOperator) {
      return false;
    }
  
    var isInvalidNe = Object.keys(matcher).length === 1 &&
      getKey(matcher) === '$ne';
  
    return !isInvalidNe;
  }
docs: check all the index fields for usages of '$ne' e.g. if the user queries {foo: {$ne: 'foo'}, bar: {$eq: 'bar'}}, then we can neither use an index on ['foo'] nor an index on ['foo', 'bar'], but we can use an index on ['bar'] or ['bar', 'foo']