I am following this thred
But I am getting "The attempted operation is prohibited because it exceeds the list view threshold". Basically, I want to get the latest 10 modified documents from specific folder of the document library. So I am using below CAML viewXML
camlQuery.ViewXml = @"<View Scope='Recursive'><Query><OrderBy Override='TRUE'><FieldRef Name='Modified' Ascending='False'/></OrderBy></Query><ViewFields><FieldRef Name='Title' /><FieldRef Name='Modified' /><FieldRef Name='FileDirRef' /><FieldRef Name='FileLeafRef' /></ViewFields><RowLimit Paged='TRUE'>10</RowLimit></View>";
camlQuery.FolderServerRelativeUrl = "/clients/account/Account_Demo";
As soon as I specify "Modified" in Order by - this quey throws an error of list view threshold.
Just to share Modified is indexed column
If I remove <FieldRef Name='Modified' Ascending='False'/> from Order By then query works fine but does not serve the purpose of the latest 10.