Query with condition on attribute existence. How-to manage an if xx.length or