I get the view limit exception when I make a request to the SharePoint online api that has more than 5K items in the view. I want to be able to count the number of items in the view without returning those items (thereby bypassing the exception).
Here is the ViewXml template that I use:
<View>
<RowLimit>1000</RowLimit>
<Query>
<Where>
<And>
<Geq>
<FieldRef Name="{2}"></FieldRef>
<Value Type="DateTime">{0:yyyy-MM-dd}</Value>
</Geq>
<Leq>
<FieldRef Name="{2}"></FieldRef>
<Value Type="DateTime">{1:yyyy-MM-dd}</Value>
</Leq>
</And>
</Where>
</Query>
</View>