index.js
function buildQuery(opts, globalSearch) {
    var imboQuery = new ImboQuery();

    imboQuery.page(opts.page);
    imboQuery.limit(opts.limit);

    if (opts.users && globalSearch) {
        imboQuery.users(opts.users);
    }

    if (opts.fields) {
        imboQuery.fields(opts.fields);
    }

    if (opts.sort) {
        imboQuery.addSorts(opts.sort);
    }

    if (opts.metadata) {
        imboQuery.metadata(opts.metadata);
    }

    return imboQuery;
}
function buildQuery(opts, globalSearch) {
    var imboQuery = new ImboQuery();

    imboQuery.page(opts.page);
    imboQuery.limit(opts.limit);

    if (opts.users && globalSearch) {
        imboQuery.users(opts.users);
    }

    if (opts.fields) {
        imboQuery.fields(opts.fields);
    }

    if (opts.sort) {
        imboQuery.addSorts(opts.sort);
    }

    if (opts.metadata) {
        imboQuery.metadata(opts.metadata);
    }

    return imboQuery;
}
function buildQuery ( opts , globalSearch ) { var imboQuery = new ImboQuery ( ) ; imboQuery . page ( opts . page ) ; imboQuery . limit ( opts . limit ) ; if ( opts . users && globalSearch ) { imboQuery . users ( opts . users ) ; } if ( opts . fields ) { imboQuery . fields ( opts . fields ) ; } if ( opts . sort ) { imboQuery . addSorts ( opts . sort ) ; } if ( opts . metadata ) { imboQuery . metadata ( opts . metadata ) ; } return imboQuery ; }
Build the query object used to build the URI string

@param {Object} opts - Metadata query options
@param {bool} globalSearch - Whether we're searching globally or not
@return {Query}
Build the query object used to build the URI string