Comment 0 for bug 2024311

Revision history for this message
Sylvan Le Deunff (sylvanld) wrote :

Documentation gives example on how to use "where" operator with constants filters (like "1" and "John", in example below)

$.customers.where($.orders.len() >= 1 or name = "John")

In real life applications, users will most likely need to use variables defined from context.
I couldn't find how to do this in the documentation, only by reading the code.

I suggest adding the following example in Quickstart (https://opendev.org/openstack/yaql/src/branch/master/README.rst)

let(target_age => $.target_age)->$.users.where($.age=$target_age)

And maybe adding a brief description of operation "context pass" (->) which is barely mentioned in the doc and not explained at all.