There are a lot of new features to be found in version 2.0.0, including keyword arguments, arithmetic in arguments, many new specials, and bug fixes.
* `2.0.0`
* Numerous new language features
* Support for arithmetic in arguments. The supported operators are
`-`, `+`, `*`, `/`, `//` (floor division), `**` (exponentiation), and `%`. The operators can be used any
place a value is valid within an argument, such as `$special(14000 * 2)`, `$special(value // 2)`,
`$special([1, 1+1, 1+2])`. The order of operations follows typical precedence, and arithmetic
can be nested in `()`.
* Support for keyword arguments:`$index("value", fallback=12)`
* Whitespace is allowed in a lot more places in a query now, which is very helpful since both
JavaScript and Python support multi-line strings.
* Performance increase for cases were a `Query` field doesn't have any specials. A faster parsing
method can be used for about a 40x performance increase in creating the `Query` object. Note, this
just speeds up `Query` creation and not the speed of `.single()`, `.many()`, etc.
* Added functionality so that `Filter` values can be queries.
* Using JSON: `{ field: <field>, operator: <op>, value: { query: <value query> } }`
* Using `Key`: `Key(<field>).<op>(Key(<value_query>))`
* For example: `Key("tag.tag1").gt(Key("tag.tag2"))`
* Four new filters: `subset`, `!subset`, `superset`, `!superset`. These should be read
`field value <op> filter value`, so `subset` means all of the values returned from the field query
are in the filter value, which allows better filtering when both the field query and value are iterable.
* Many new specials
* `$key_of_min_value` - Gets the key of the min value in an dict/map/object
* `$key_of_max_value` - Gets the key of the max value in an dict/map/object
* `$time_part(part) -> int` - Get a specific part of a datetime/moment object. Valid values for `part` are as follows:
* 'millisecond'
* 'second'
* 'minute' - Starting from 0
* 'hour' - Starting from 0
* 'day' - Day of month, starting from 1
* 'month' - Month of year, starting from 1
* 'year'
* 'dayOfWeek' - Value in 0-6, corresponding to Monday-Sunday
* 'dayOfYear' - Day of year, starting from 1
* `$min` and `$max`
* `$arith(op, arg_value)` - Perform an arithmetic operation on the current value. `op` can be
any of the support [math operators](math-operators).
* `$lowercase`, `$uppercase`, and `$titlecase`
* `$filter(field, op, value, single=true)` OR `$filter({<filter>}, single=true)` OR
`$filter([<filters>], single=true)` - Allow a single value or list of values to be filtered.
The filters should be formatted that same way they are for `Filter`.
* `$pipeline(pipeline)` - Apply multiple specials to value in a given order. Can be very useful
when used in conjunction with `$map` to apply multiple specials at once. `pipeline` must be of format:
[
<special>
OR
[<special>, arg1, arg2, ..., (optional) map/object/dict of keyword arguments],
...
]
for example
$pipeline([
['index', 'balance'],
['range', 1],
['replace', {'old': ',', 'new': ''}],
['float']
])
is the same as
$index("balance").$range(1).$replace(old=",", new="").$float
* Updates to old specials
* `$index(i, fallback=null, extended=false)` - added `extended` argument to allow
`$index` to support any valid JQL query for `i` if `extended=true`
* Bug fixes
* Fixed issue with filters not shortcutting properly
* Fixed Python issue with `$print`
* Fixed issues with `$fallback` with `Filter` and `Formatter`
* Fixed issue causing an error when trying to use an integer value in
`$sort` and `$group_by`