1.
Revised description for section 5.1.1.12 Lambda Operators (changes enclosed with *)
OData defines two operators that evaluate a Boolean expression on a collection. Both must be prepended with a navigation path that identifies a collection.
4.01 Services MUST support case-insensitive lambda operator names. Clients that want to work with 4.0 services MUST use lower case lambda operator names.
The argument of a lambda operator is a case-sensitive lambda variable name followed by a colon ( : ) and a Boolean expression that uses the lambda variable name to refer to properties of members of the collection identified by the navigation path.
If the name chosen for the lambda variable matches a property name of the current resource referenced by the resource path, the lambda variable takes precedence. Clients can prefix properties of the current resource referenced by the resource path with $it.
Other path expressions in the Boolean expression neither prefixed with the lambda variable nor $it are evaluated in the scope of the collection instances at the origin of the navigation path prepended to the lambda operator.
2.
To illustrate evaluation of Boolean expressions not starting with a lambda variable or $it, add two examples to section 5.1.1.12.1 and 5.1.1.12.2:
Example 92’: all employees having an order with a deviating shipping address
http://host/service/Employees?$filter=Orders/any(o:o/ShipAddress ne Address)
The Address path expression included in the predicate expression of the any lambda operator is evaluated in the scope of the Employee collection, because they are the origins of the Orders collection path prepended to the any operator.
Example 93’: all categories along with their products used in some order with a deviating unit price
http://host/service/Categories?$expand=Products($filter=OrderItems/any(od:od/UnitPrice ne UnitPrice)
UnitPrice is a path expression included in the predicate expression of the any lambda operator that gets evaluated in the scope of expanded product instances, because these are the origins of the OrderItems collection path prepended to the any operator.