Support minItems/maxItems using sub-query