limits

What one evaluation of this query is allowed to cost. See JsonPathLimits.

On the query rather than on the call because it belongs with the expression it bounds: a caller that compiled something untrusted should not have to remember to pass the limits again at every use. forEachNodeIn takes an override for the case where one document is known to be larger than the rest.