index.js
function () {
    var _orBuilder = this;
    var _queries = [];
    var _currentChildBuilder = new ChildQueryBuilder(_orBuilder);

    /**
     * Process the current OR entry, and continue adding to this OR
     * query group.
     * @returns {ChildQueryBuilder} A new {@link ChildQueryBuilder}
     * child in this OR group.
     */
    this.or = function () {
        _orBuilder.flush();
        return _currentChildBuilder;
    };

    /**
     * Returns the array of query objects generated by this
     * builder.
     * @returns {Array.<{}>} the array of query objects generated
     * by this builder.
     */
    this.flush = function () {
        // save current builder
        var q = _currentChildBuilder.build();
        // only if the query is non-empty
        if (Object.keys(q).length) {
            if (!dataUtils.arrayContainsValue(_queries, q)) _queries.push(q);
            // renew current builder
            _currentChildBuilder = new ChildQueryBuilder(_orBuilder);
        }
        return _queries;
    };
}
function () {
    var _orBuilder = this;
    var _queries = [];
    var _currentChildBuilder = new ChildQueryBuilder(_orBuilder);

    /**
     * Process the current OR entry, and continue adding to this OR
     * query group.
     * @returns {ChildQueryBuilder} A new {@link ChildQueryBuilder}
     * child in this OR group.
     */
    this.or = function () {
        _orBuilder.flush();
        return _currentChildBuilder;
    };

    /**
     * Returns the array of query objects generated by this
     * builder.
     * @returns {Array.<{}>} the array of query objects generated
     * by this builder.
     */
    this.flush = function () {
        // save current builder
        var q = _currentChildBuilder.build();
        // only if the query is non-empty
        if (Object.keys(q).length) {
            if (!dataUtils.arrayContainsValue(_queries, q)) _queries.push(q);
            // renew current builder
            _currentChildBuilder = new ChildQueryBuilder(_orBuilder);
        }
        return _queries;
    };
}
function ( ) { var _orBuilder = this ; var _queries = [ ] ; var _currentChildBuilder = new ChildQueryBuilder ( _orBuilder ) ; /**
     * Process the current OR entry, and continue adding to this OR
     * query group.
     * @returns {ChildQueryBuilder} A new {@link ChildQueryBuilder}
     * child in this OR group.
     */ this . or = function ( ) { _orBuilder . flush ( ) ; return _currentChildBuilder ; } ; /**
     * Returns the array of query objects generated by this
     * builder.
     * @returns {Array.<{}>} the array of query objects generated
     * by this builder.
     */ this . flush = function ( ) { // save current builder var q = _currentChildBuilder . build ( ) ; // only if the query is non-empty if ( Object . keys ( q ) . length ) { if ( ! dataUtils . arrayContainsValue ( _queries , q ) ) _queries . push ( q ) ; // renew current builder _currentChildBuilder = new ChildQueryBuilder ( _orBuilder ) ; } return _queries ; } ; }
This builder helps create efficient OR queries and expressions.
@constructor
This builder helps create efficient OR queries and expressions .