added option to set querymode (full or just attributes)