lib/dataset/query.js
function (args, cb) {
            args = [this.__opts["having"] ? "having" : "where"].concat(argsToArray(arguments));
            return this._filter.apply(this, args);
        }
function (args, cb) {
            args = [this.__opts["having"] ? "having" : "where"].concat(argsToArray(arguments));
            return this._filter.apply(this, args);
        }
function ( args , cb ) { args = [ this . __opts [ "having" ] ? "having" : "where" ] . concat ( argsToArray ( arguments ) ) ; return this . _filter . apply ( this , args ) ; }
Returns a copy of the dataset with the given conditions applied to it.
If the query already has a HAVING clause, then the conditions are applied to the
HAVING clause otherwise they are applied to the WHERE clause.

@example

DB.from("items").filter({id : 3}).sql;
//=> SELECT * FROM items WHERE (id = 3)

DB.from("items").filter('price < ?', 100)
//=> SELECT * FROM items WHERE price < 100

DB.from("items").filter({id, [1,2,3]}).filter({id : {between : [0, 10]}}).sql;
//=> SELECT
*
FROM
items
WHERE
((id IN (1, 2, 3)) AND ((id >= 0) AND (id <= 10)))

DB.from("items").filter('price < 100');
//=> SELECT * FROM items WHERE price < 100

DB.from("items").filter("active").sql;
//=> SELECT * FROM items WHERE active

DB.from("items").filter(function(){
return this.price.lt(100);
});
//=> SELECT * FROM items WHERE (price < 100)

//Multiple filter calls can be chained for scoping:
DB.from("items").filter(:category => 'software').filter{price < 100}
//=> SELECT * FROM items WHERE ((category = 'software') AND (price < 100))


@param {Object|Array|String|patio.sql.Identifier|patio.sql.BooleanExpression} args filters to apply to the
WHERE/HAVING clause. Description of each:
<ul>
<li>Hash - list of equality/inclusion expressions</li>
<li>Array - depends:
<ul>
<li>If first member is a string, assumes the rest of the arguments
are parameters and interpolates them into the string.</li>
<li>If all members are arrays of length two, treats the same way
as a hash, except it allows for duplicate keys to be
specified.</li>
<li>Otherwise, treats each argument as a separate condition.</li>
</ul>
</li>
<li>String - taken literally</li>
<li>{@link patio.sql.Identifier} - taken as a boolean column argument (e.g. WHERE active)</li>
<li>{@link patio.sql.BooleanExpression} - an existing condition expression,
probably created using the patio.sql methods.
</li>

@param {Function} [cb] filter also takes a cb, which should return one of the above argument
types, and is treated the same way.  This block is called with an {@link patio.sql} object which can be used to dynaically create expression.  For more details
on the sql object see {@link patio.sql}

<p>
<b>NOTE:</b>If both a cb and regular arguments are provided, they get ANDed together.
</p>

@return {patio.Dataset} a cloned dataset with the filter arumgents applied to the WHERE/HAVING clause.
Returns a copy of the dataset with the given conditions applied to it . If the query already has a HAVING clause then the conditions are applied to the HAVING clause otherwise they are applied to the WHERE clause .