add support for array returns in element query
[cherry pick commit from stewartoallen a0549909393c8e3206c30becd2bf357adbb97b77]