lib/query-builder.js
function and() {
  var args = mlutil.asArray.apply(null, arguments);
  var queries = [];
  var ordered = null;
  var arg = null;
  for (var i=0; i < args.length; i++) {
    arg = args[i];
    if (ordered === null) {
      if (arg instanceof OrderedDef) {
        ordered        = arg.ordered;
        continue;
      } else if (typeof arg === 'boolean') {
        ordered        = arg;
        continue;
      }
    }

    if (arg instanceof Array){
      Array.prototype.push.apply(queries, arg);
    } else {
      queries.push(arg);
    }
  }

  return new AndDef(new QueryListDef(queries, ordered, null, null));
}
function and() {
  var args = mlutil.asArray.apply(null, arguments);
  var queries = [];
  var ordered = null;
  var arg = null;
  for (var i=0; i < args.length; i++) {
    arg = args[i];
    if (ordered === null) {
      if (arg instanceof OrderedDef) {
        ordered        = arg.ordered;
        continue;
      } else if (typeof arg === 'boolean') {
        ordered        = arg;
        continue;
      }
    }

    if (arg instanceof Array){
      Array.prototype.push.apply(queries, arg);
    } else {
      queries.push(arg);
    }
  }

  return new AndDef(new QueryListDef(queries, ordered, null, null));
}
function and ( ) { var args = mlutil . asArray . apply ( null , arguments ) ; var queries = [ ] ; var ordered = null ; var arg = null ; for ( var i = 0 ; i < args . length ; i ++ ) { arg = args [ i ] ; if ( ordered === null ) { if ( arg instanceof OrderedDef ) { ordered = arg . ordered ; continue ; } else if ( typeof arg === 'boolean' ) { ordered = arg ; continue ; } } if ( arg instanceof Array ) { Array . prototype . push . apply ( queries , arg ) ; } else { queries . push ( arg ) ; } } return new AndDef ( new QueryListDef ( queries , ordered , null , null ) ) ; }
Builds a query for the intersection of the subqueries.
@method
@since 1.0
@memberof queryBuilder#
@param {...queryBuilder.Query} subquery - a word, value, range, geospatial,
or other query or a composer such as an or query.
@param {queryBuilder.OrderParam} [ordering] - the ordering on the subqueries
returned from {@link queryBuilder#ordered}
@returns {queryBuilder.Query} a composable query
Builds a query for the intersection of the subqueries .